Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Suppressing Input Box
I have an application that prompts me to enter data on startup into an input
box and after saving. I also have a Workbook_BeforeClose event that saves the file when closing, but it calls the BeforeSave event I have. Is there a way to save without calling the BeforeSave event? -- I am running on Excel 2003, unless otherwise stated. Please rate posts so we know when we have answered your questions. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Suppressing Input Box
I forgot to mention the procedure that incorporates the input box (in
ThisWorkbook): Private Sub Deposit() Application.StatusBar = something Range("A1").Value = InputBox(Prompt, Title) Call Messages.Messages End Sub As a reference, here are the occurrences of this procedu Private Sub Workbook_BeforeSave(ByVal SaveAsUi As Boolean, Cancel As Boolean) 'Performs actions of Workbook_BeforeClose but does not close the workbook when complete Call Workbook_BeforeClose(True) End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Resets workbook and saves file Sheets(1).Select Range("All").ClearContents Range("A3").Select If Cancel = False Then ThisWorkbook.Save Application.StatusBar = False End If If Cancel = True Then Call Deposit End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Suppressing Input Box
You can use the EnableEvents property to prevent Excel from calling
event procedures. E.g, Application.EnableEvents = False ' save the file. won't call BeforeSave Application.EnableEvents = True Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Thu, 16 Oct 2008 09:41:00 -0700, Orion Cochrane wrote: I have an application that prompts me to enter data on startup into an input box and after saving. I also have a Workbook_BeforeClose event that saves the file when closing, but it calls the BeforeSave event I have. Is there a way to save without calling the BeforeSave event? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Suppressing Input Box
Perfect! This will help me with other applications I use. Thanks, Mr. MVP
(Most Valuable Programmer) :) -- I am running on Excel 2003, unless otherwise stated. Please rate posts so we know when we have answered your questions. Thanks. "Chip Pearson" wrote: You can use the EnableEvents property to prevent Excel from calling event procedures. E.g, Application.EnableEvents = False ' save the file. won't call BeforeSave Application.EnableEvents = True Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Thu, 16 Oct 2008 09:41:00 -0700, Orion Cochrane wrote: I have an application that prompts me to enter data on startup into an input box and after saving. I also have a Workbook_BeforeClose event that saves the file when closing, but it calls the BeforeSave event I have. Is there a way to save without calling the BeforeSave event? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Suppressing a message box | Excel Programming | |||
Suppressing events | Excel Programming | |||
Suppressing output | Excel Programming | |||
Suppressing output | Excel Programming | |||
Suppressing messages | Excel Programming |