Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default how to intrupt Save and Save as?

You can check for whatever you want to check in the Workbook_BeforeSave event
(which MUST be in the Thisworkbook code) and if it's not to be saved, simply
set
Cancel = True
Application.Quit (or Thisworkbook.Close False)

"Edward" wrote:

Thanks Barb, Basically my goal is to use the code to let the user to sort a
protected worksheet via vba ( I know have the code ) but the problem is user
can save the sorted workbook which im trying to avoid. I thought if I can
intrupt the save and save as then I can open a inputbox and if user gives a
correct password save the workbook otherwise exit the application without
saving . It seems Workbook_beforeSave is not working and gives the opetion of
savig. do you know that this idea is even possible?
--
Best regards,
Edward


"Barb Reinhardt" wrote:

You could add some Workbook_BeforeSave code to the workbook. I can't seem
to find a good reference now, but you should be able to find something by
Googling on it. Make sure you put this in the ThisWorkbook module.
--
HTH,
Barb Reinhardt



"Edward" wrote:

Hi everybody,
How can we intrupt Save and Save as in Excel ? I want to write my own code
instead of svaing a document when user clciks on save
--
Best regards,
Edward

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
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
SAVE and SAVE AS options disappeared from the drop down FILE menu [email protected] Excel Discussion (Misc queries) 2 July 12th 07 09:14 AM
Save As and save current numbers not the actual formulas and links Frank Menard Excel Discussion (Misc queries) 2 November 9th 06 09:18 PM
Command Button Save As Application.ExecuteExcel4Macro ("SAVE.AS?() Paul Dennis Excel Discussion (Misc queries) 5 September 18th 06 05:34 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM


All times are GMT +1. The time now is 09:35 PM.

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"