Results 1 to 4 of 4

Thread: Quitting Excel from code

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2003
    Posts
    49

    Quitting Excel from code

    Hi,
    I open Excel in non-visible mode from VB. If an error occurs I make sure Excel is closed in the correct manner, however, if data has been added to a sheet and the close instruction is run a message box appears asking if I wish to save the spreadsheet.

    Anyone know how I can prevent this message from appearing without destroying Excel in a horrible way? I guess I'm after some method of pressing the 'no - don't save' button on the Excel messagebox.

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    xlApp.DisplayAlerts = False

  3. #3
    Fanatic Member
    Join Date
    Jun 2003
    Location
    IL
    Posts
    739
    If you have an excel object in vb you can do this


    xlApp.DisplayAlerts = False

    Then it won't give you any messages from excel and it will treat it as you don't want to save.
    Motto: Anything for a laugh.

    Getting second place only means you are the first loser to cross the finish line.

  4. #4
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

Posting Permissions

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



Click Here to Expand Forum to Full Width