Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default how to avoid user to save in .xlsx

Hi!

I have an add-in (.xlam) which copies a worksheet (which contains a
Sub worksheet_calculate) in the current workbook.

However, if the current workbook is an .xlsx format, and the user
still saves in .xlsx format (regardless the message box saying that
the macro will be deleted), the new inserted worksheet will lost its
Sub worksheet_calculate.

I really need to keep the Sub worksheet_calculate.

Is there any code/fonction/way to avoid that the used save in .xlsx?
The current workbook can be an existing file with .xlsx format, or a
new freshly created workbook.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default how to avoid user to save in .xlsx

On Jul 26, 1:06*pm, Mathieu936 wrote:
Hi!

I have an add-in (.xlam) which copies a worksheet (which contains a
Sub worksheet_calculate) in the current workbook.

However, if the current workbook is an .xlsx format, and the user
still saves in .xlsx format (regardless the message box saying that
the macro will be deleted), the new inserted worksheet will lost its
Sub worksheet_calculate.

I really need to keep the Sub worksheet_calculate.

Is there any code/fonction/way to avoid that the used save in .xlsx?
The current workbook can be an existing file with .xlsx format, or a
new freshly created workbook.

Thanks!


Look in the ThisWorkbook module for before save and stop it within
that.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default how to avoid user to save in .xlsx

On 26 juil, 20:03, Don Guillett Excel MVP
wrote:

Look in the ThisWorkbook module for before save and stop it within
that.- Masquer le texte des messages précédents -


I tried it but the BeforeSave event happens before saving. So I could
popup a message box saying to not save in .xlsx, but after user could
save in .xlsx which is bad.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default how to avoid user to save in .xlsx


You could make the 'BeforeSave' event force-save the workbook as .XLSm, set
Cancel = True after the saving is done, and perhaps let a MsgBox inform the
user that the workbook was saved as .XLSm instead of .XLSx

CE



"Mathieu936" skrev i en meddelelse
...
On 26 juil, 20:03, Don Guillett Excel MVP
wrote:

Look in the ThisWorkbook module for before save and stop it within
that.- Masquer le texte des messages précédents -


I tried it but the BeforeSave event happens before saving. So I could
popup a message box saying to not save in .xlsx, but after user could
save in .xlsx which is bad.


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
Want Macro to save to .xlsx John Yab Excel Programming 2 November 21st 09 12:24 AM
save xlsx files Kim Carlsen Excel Programming 1 June 12th 09 04:41 PM
Unable to save XLSX files without using 'Save As' and different na SlackerBoy Setting up and Configuration of Excel 1 March 14th 09 09:14 PM
How to default file save format to .xlsx in Excel? Carina Excel Discussion (Misc queries) 12 February 9th 09 07:26 PM
Save Workbook As .xlsx to Remove Macros? char507 Excel Programming 2 December 11th 08 09:23 PM


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