Close a Workbook

dantb

Active Member
Joined
Mar 20, 2002
Messages
358
Hi all, Beginer here. Is there a way to Close a Workbook ?, I am trying to have a Cmd button that Closes a workbook, and after, return to another.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Yes, I have a cmd button, that opens a workbook, the workbook is protected (windows). The Prob is , when I connect, since it is protected windows, there is no close button. And If I close, It closes All Workbooks
 
Upvote 0
So, if I'm right, you want a command button in Workbook 2 that will open and close Workbook 1??

Not very difficult, if that's what you want.
 
Upvote 0
You've tried this?

Windows("WorkbookName.xls").Activate
ActiveWorkbook.Close
 
Upvote 0
Like I said, a beginer Dream. Im sure that is the correct code, I just couldnt figure it out.. Thx you so much Dan
 
Upvote 0
Cool! Cause I sure don't consider myself a coder. I recorded that one, Dan. :)
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top