Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
slm slm is offline
external usenet poster
 
Posts: 3
Default Problem with closing workbook in macro

Hi,

In a macro written in Excel2000, I close a workbook using method
workbook.close(false) and this working well.
Now we are using Excel 2003 and workbook doesn't close. Popup "Do you want
to save..." appears and even if you click yes, no or cancel, workbook doesn't
close and macro follows running without problem.

Any idea?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Problem with closing workbook in macro

I've never seen a difference in the way xl2k and xl2003 will handle this.

But maybe you have a workbook_beforeclose event firing in that other workbook.

(And I wouldn't use a variable named Workbook. It confuses me, even if xl lets
you do it.)

application.enableevents = false
mywkbk.close savechanges:=false
application.enableevents = true


===
Is it the same workbook that was used in xl2k that you're using in xl2003? If
it is (and you haven't made any changes), then I don't think that this is the
answer.



slm wrote:

Hi,

In a macro written in Excel2000, I close a workbook using method
workbook.close(false) and this working well.
Now we are using Excel 2003 and workbook doesn't close. Popup "Do you want
to save..." appears and even if you click yes, no or cancel, workbook doesn't
close and macro follows running without problem.

Any idea?

Thanks


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set macro to run automatically when closing workbook? Wuddus Excel Discussion (Misc queries) 10 January 20th 15 03:39 PM
Closing Excel with Personal Macro Workbook [email protected] Excel Discussion (Misc queries) 6 November 7th 07 11:07 PM
CLosing Excel 2007 with personal macro workbook Kato Wilbur Excel Discussion (Misc queries) 3 March 13th 07 09:59 PM
Problem closing a workbook using a macro Steve Excel Programming 3 September 21st 04 01:03 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"