+ Reply to Thread
Results 1 to 2 of 2

Problem with closing workbook in macro

  1. #1
    slm
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1