Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Intercepting the Save

I want to run a little code when the user saves the workbook. How can I
intercept the Save command?


Dennis

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Intercepting the Save

Nevermind, I found it. It's the Workbook_BeforeSave event.


Dennis

"Dennis Tucker" wrote in message
...
I want to run a little code when the user saves the workbook. How can I
intercept the Save command?


Dennis

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Intercepting the Save

From workbook press Alt+F11 to launch VBE (Visual Basic Editor). From the
left treeview search for the workbook name and click on + to expand it.
Within that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Msgbox "Cannot Save"
'to cancel the save
Cancel = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Dennis Tucker" wrote:

I want to run a little code when the user saves the workbook. How can I
intercept the Save command?


Dennis

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
Intercepting the file save prompt before close? Neil Bhandar[_4_] Excel Programming 3 February 14th 06 03:19 AM
Intercepting Save and Exit menu command in Excel PeteMann Excel Programming 1 August 4th 05 11:28 PM
Intercepting a Tab on Entry Marston Excel Programming 1 October 15th 04 08:27 PM
intercepting password routines Dick B[_2_] Excel Programming 1 November 8th 03 12:43 AM
Intercepting Paste Function MrAlMackay Excel Programming 4 September 25th 03 04:23 PM


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