D
Dave McL.
The following code snippet works fine in Excel 2003, but XP behaviour is
different.
In Excel XP I get prompted to save the file twice.
Any ideas - TIA Dave
Private Sub m_ThisApplication_WorkbookBeforeSave(ByVal Wb As
Microsoft.Office.Interop.Excel.Workbook, ByVal SaveAsUI As Boolean, ByRef
Cancel As Boolean) Handles m_ThisApplication.WorkbookBeforeSave
If SaveAsUI Then
sBeforeSaveFilename = Wb.Name
m_ThisApplication.EnableEvents = False
m_ThisApplication.Dialogs(xlDialogSaveAs).Show()
' prevent a second save
m_ThisApplication.EnableEvents = True
Cancel = True
End If
Wb = Nothing
different.
In Excel XP I get prompted to save the file twice.
Any ideas - TIA Dave
Private Sub m_ThisApplication_WorkbookBeforeSave(ByVal Wb As
Microsoft.Office.Interop.Excel.Workbook, ByVal SaveAsUI As Boolean, ByRef
Cancel As Boolean) Handles m_ThisApplication.WorkbookBeforeSave
If SaveAsUI Then
sBeforeSaveFilename = Wb.Name
m_ThisApplication.EnableEvents = False
m_ThisApplication.Dialogs(xlDialogSaveAs).Show()
' prevent a second save
m_ThisApplication.EnableEvents = True
Cancel = True
End If
Wb = Nothing