LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Why does Excel ask me to save changes?

Hi

I have a little workbook with two sheets.
On the sheet in the front (named Start) I have placed a ListBox (named
lstTemplates, ListFillRange:Tabel!A:A) and a CommandBottom (named cmdSelect)
and a CommandBottom (named cmdCancel).
On the sheet in the background (named Table) I have the data used to fill in
the listbox and the macros below.

If I open the workbook and immediately clicks on cmdCancel, the Excel asks
me if I want to save changes.
To avoid this question I have to uncomment the "ActiveWorkbook.Save".

Why is it necessary to save? I haven't changed anything!
Is there a way to avoid the "'ActiveWorkbook.Save" before the
"Application.Quit"?
I have tried with a "ActiveWorkbook.Close SaveChanges = False", but the
"Application.Quit" didn't execute.
The .xls file will be placed in a writeprotected area, therefor the
"ActiveWorkbook.Save" will be a bad idear to use.

Macroes related to sheet "Start" ------------------------------------ begin
Private Sub cmdCancel_Click()
If Workbooks.Count 1 Then
ActiveWorkbook.Close SaveChanges = False
Else
'ActiveWorkbook.Save
Application.Quit
End If
End Sub

Private Sub cmdSelect_Click()
OpenTemplate
End Sub

Private Sub lstTemplates_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
OpenTemplate
End Sub

Private Sub OpenTemplate()
Dim WorkbookName As String
Dim i As Integer
If lstTemplates.ListIndex 0 And lstTemplates.Value < "" Then
WorkbookName = Worksheets("Table").Range("B" &
(lstTemplates.ListIndex + 1)) & _
"\" & Worksheets("Table").Range("C" & (lstTemplates.ListIndex +
1))
Workbooks.Open (WorkbookName)
Else
MsgBox ("No template is selected")
End If
End Sub

Macroes related to sheet "Start" ------------------------------------ end

Kind regards - Ebbe


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
'document not saved' for 'save' or 'save as' an EXCEL file Judy Chuang Excel Discussion (Misc queries) 1 July 11th 05 10:12 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM
save button in excel to save one of the worksheets with a cell value as its name Colin[_9_] Excel Programming 2 September 21st 04 11:28 PM


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"