LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default The wrong workbook gets saved!

I have a menu option in my addin which lets the user see and change a
parameters sheet, with paths to other workbooks etc.

Sub ShowParameters(FakeArg as boolean)
thisworkbook.isaddin=false
end sub

To ensure that it doesn't get saved with the parameters showing, I've put
the following code in the ThisWorkbook module of the addin:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _

Cancel As Boolean)
Msgbox "The BeforeSave event of the addin was triggered"
ThisWorkbook.IsAddin=true
'After this runs, the ActiveWorkbook gets saved instead of this one.
End Sub

If there is any other workbook open, then it gets saved instead of the
addin. Is this a bug in Excel or am I doing something wrong???

Thanks
Rob
 
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
2007 file saved as .xls prints wrong on computer w 2003 software bz Excel Discussion (Misc queries) 6 November 17th 08 11:45 AM
"Document not saved" message. What is wrong? Phil Excel Discussion (Misc queries) 1 June 27th 07 04:44 PM
I keep losing saved Excel macros, what am I doing wrong? GTNet_Boss New Users to Excel 2 October 27th 05 11:01 PM
How can I see a copy of a saved workbook before I saved it again? Norma Excel Worksheet Functions 2 May 11th 05 10:31 AM
how do I recover a file where I accidently saved it as the wrong f Ray Excel Worksheet Functions 1 April 28th 05 12:02 PM


All times are GMT +1. The time now is 03:32 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"