Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Triggering an Excel macro on press of SAVE

Hi,

I want to perform some check before saving an excel worksheet.
If the check is successful, then only should the worksheet be
saved, else i'd like to give a simple error message.

Could someone tell me if it is possible to trigger
an excel macro (developed by the user) when the
standard SAVE button on the toolbar is pressed ?
and within that i'd like to call the standard SAVE functionality
once my checks are successful.

Thanks in advance,
Darshan
  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Triggering an Excel macro on press of SAVE

Darshan,

Look at the BeforeSave event. It's in module ThisWorkbook. You have to
change the object (left) dropdown from (General) to Workbook, then in the
Procedure (right) dropdown, select BeforeSave. You'll see

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)

End Sub

Put your code in there.

Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"darshan" wrote in message
om...
Hi,

I want to perform some check before saving an excel worksheet.
If the check is successful, then only should the worksheet be
saved, else i'd like to give a simple error message.

Could someone tell me if it is possible to trigger
an excel macro (developed by the user) when the
standard SAVE button on the toolbar is pressed ?
and within that i'd like to call the standard SAVE functionality
once my checks are successful.

Thanks in advance,
Darshan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Triggering an Excel macro on press of SAVE

sure you can

in the VB editor, select the Workbook in proj. explorer.

in the code editor, select 'workbook' as the object, then select the
'before save' event

then you may put your checks in there


---
Message posted from http://www.ExcelForum.com/

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
If I press Save instead of Save as where's my file? Ginger Excel Discussion (Misc queries) 4 August 27th 09 08:53 PM
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
Password a Macro so certain users can press it [email protected] Excel Discussion (Misc queries) 2 September 28th 06 04:44 PM
Function triggering a macro Leon Excel Worksheet Functions 1 December 22nd 05 07:26 AM
Daily Macro Triggering JB2010 Excel Discussion (Misc queries) 2 November 2nd 05 04:28 PM


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