close workbook method

pm

New Member
Joined
Apr 24, 2002
Messages
19
is it safe to use this?
When I use it my program crashes, however if I run it in debug mode it works..To debug I put 2 print statements, one before the close method and one after the close method..it just sits on the close method and does not print my second debug line..
I am stumped!
I have 2 workbooks open at the time..and I have to close the one that is active
I used Activeworkbook.close

please help
tia
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
On 2002-05-10 14:12, pm wrote:
is it safe to use this?
When I use it my program crashes, however if I run it in debug mode it works..To debug I put 2 print statements, one before the close method and one after the close method..it just sits on the close method and does not print my second debug line..
I am stumped!
I have 2 workbooks open at the time..and I have to close the one that is active
I used Activeworkbook.close

please help
tia

Could you be hanging up on a DisplayAlert asking you if you want to save? Try adding the following lines around the ActiveWorkBook.Close line and see if it works:

Application.DisplayAlerts = False
ActiveWorkbook.Close 'this is your line
Application.DisplayAlerts = True
 
Upvote 0
Or add a word, should close w/o save either way:

Code:
ActiveWorkbook.Close False

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
wave.gif

This message was edited by NateO on 2002-05-10 14:34
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,938
Members
448,534
Latest member
benefuexx

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