Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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
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
Suppressing a message box Matt Excel Programming 1 December 7th 05 03:30 PM
Suppressing events rci Excel Programming 3 February 10th 05 07:10 PM
Suppressing output Norman Jones Excel Programming 0 September 8th 04 04:35 PM
Suppressing output Iain King Excel Programming 0 September 8th 04 04:34 PM
Suppressing messages Ron de Bruin Excel Programming 0 September 4th 03 03:51 PM


All times are GMT +1. The time now is 04:52 AM.

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

About Us

"It's about Microsoft Excel"