Problem with closing workbook in macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top