Welcome, Guest. Please login or register.
Login with username, password and session length

 
Advanced search

18539 Posts in 4847 Topics- by 32743 Members - Latest Member: watty
 

AdvancedQTP forums have been nominated as a finalist in ATI’s 2nd annual automation honors awards!

We’d like to thank you for your continued support and participation, and urge you to hurry and vote.

Make you voice count! 


Pages: [1]   Go Down
Print
0 Members and 1 Guest are viewing this topic.
Author Topic: .quit still asks if I want to save    (Read 367 times)
joe loyzaga
FRProject
Advanced User
*
Offline Offline

Posts: 524

I live in Sydney


« on: March 03, 2010, 10:45:50 PM »

opens an excel worksheet - but when I call xl.quit it stills prompts with a dialog box whether to save - but I don't want it EVER to save - is there a way to open read only? or force no save?


   Set xl = CreateObject("Excel.Application")
   If Err.Number <> 0 Then
      MsgBox "Failed to initiate Excel." & vbCrLf &  "This operation requires Excel to be installed.", vbCritical
      Exit Function
   End If

   ' Open specified workbook   
   xl.Workbooks.Open(sFileName)
   If Err.Number <> 0 Then
      MsgBox "Specified Excel file '" & sFileName & "'." & vbCrLf & "Make sure the file name is correct.", vbCritical
      xl.Quit
Logged
Gautham Maroli
FRProject
Full User
*
Offline Offline

Posts: 155


« Reply #1 on: March 03, 2010, 10:52:43 PM »

you can use:
xl.DisplayAlerts = false
Logged
Tarun Lalwani
Advanced User
*****
Offline Offline

Posts: 894



WWW
« Reply #2 on: March 03, 2010, 10:55:46 PM »

Well if you make a change then the prompt would come. To avoid you should close the workbook before quitting

xl.Workbooks.Close False 'Close and don't save
Logged

Tarun Lalwani,
QuickTest Professional Unplugged - My new Book on QTP...
Pages: [1]   Go Up
Print
Jump to: