+ Reply to Thread
Results 1 to 4 of 4

Closing a Workbook, discard modifications

  1. #1
    Registered User
    Join Date
    01-15-2009
    Location
    Rio de Janeiro
    MS-Off Ver
    Excel 2003
    Posts
    3

    Unhappy Closing a Workbook, discard modifications

    I have a VBA macro that catches data from website, copies it to a workbook, closes the temporary WB and goes back to the original WB. In order to automate the process, I use the sequence, when closing the WB:
    .
    Please Login or Register  to view this content.
    .
    After working well for about 2 years, suddenly the little window asking whether or not I want to keep modifications to the tem WB shows again:
    "Do you wish to save the modifications ? "
    .
    Logic:
    1. Gets stock ticker from column "A"
    2. Consults a stock website, which return a page with data
    3. Searchs inside that page, does little change, gets the data
    4. Copies data
    5. Closes the temp WB, discarding changes
    6. Writes data obteined to main WB
    7. Loop
    .
    This is a repetitive process, more than 1.000 iterations. I need it fully automated, as it has been for 2 years, via the use of
    Application.DisplayAlerts = False
    .
    My feeling is that I must have done something very wrong with Excel options or something - without noticing - for this to happen.
    .
    Any thoughts would be very much appreciated.
    .
    The WB is here, should someone cares to take a peek (less than 100KB):
    .
    http://rapidshare.com/files/18307731...ECOTA.zip.html
    .
    Comments in the VBA macro are in portuguese, but the code is standard, of course.
    .
    I also removed competely MS Office 2003 pt-BR and reinstalled, for no luck.

    Thanks !
    Last edited by royUK; 01-15-2009 at 05:37 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419
    Please use code tags in future.

    Why not use the SaveChanges argument?

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I will add them this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    09-18-2008
    Location
    Switzerland
    MS-Off Ver
    Office 2003
    Posts
    82
    Hi,

    I always use:
    Please Login or Register  to view this content.
    That works like a treat and doesn't disable all the alerts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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