Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Display "macro-free workbooks - VB project message" on closing Exc

My codes image a table in Office 2003 excel template with macro enable, after
I update to Office 2007, I get this error message on closing the workbook:
The following features cannot be saved in macro-free workbooks:
VB project
To save a file with these features, click No, and then choose a
macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.

Is there a way I can suppress this message programmatically? Or using Office
2007 policy?
It seems that Office 2007 does not allow to save as .xlsx with macro.
Thanks for your help.

  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: Display "macro-free workbooks - VB project message" on closing Exc

Yes, there is a way to suppress this message programmatically. You can use VBA code to save the workbook as a macro-enabled file type (.xlsm) instead of a macro-free file type (.xlsx). Here's an example code:

Formula:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
    
Application.DisplayAlerts False
    ThisWorkbook
.SaveAs ThisWorkbook.FullNameFileFormat:=xlOpenXMLWorkbookMacroEnabled
    Application
.DisplayAlerts True
End Sub 
This code will run automatically when the workbook is closed. It first turns off the display alerts to suppress the message, then saves the workbook as a macro-enabled file type, and finally turns the display alerts back on.

Alternatively, you can use Office 2007 policy to disable the message. Here's how:
  1. Open the Group Policy Editor by typing "gpedit.msc" in the Run dialog box (press Windows key + R to open the Run dialog box).
  2. Navigate to User Configuration Administrative Templates Microsoft Office Excel 2007 Excel Options Security.
  3. Double-click "VBA Macro Notification Settings" to open the policy settings.
  4. Select "Disable all VBA notifications" and click OK.
  5. Close the Group Policy Editor.

This policy will disable all VBA notifications, including the message you're seeing. Note that this policy will affect all Excel workbooks, not just the one you're working on.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Display "macro-free workbooks - VB project message" on closing Exc

You need to save it once as a 'macro-enabled workbook' in 2007...
I think the type is xlsm... After that you can save the file without getting
this message...

"Gary Nguyen" wrote:

My codes image a table in Office 2003 excel template with macro enable, after
I update to Office 2007, I get this error message on closing the workbook:
The following features cannot be saved in macro-free workbooks:
VB project
To save a file with these features, click No, and then choose a
macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.

Is there a way I can suppress this message programmatically? Or using Office
2007 policy?
It seems that Office 2007 does not allow to save as .xlsx with macro.
Thanks for your help.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Display "macro-free workbooks - VB project message" on closing

Thanks for your reply.
But everytime after the user images the template, then he closes this
template, the error message diplays again.
Is there a way, I can default this template to .xlsm (or .xls) on saving
when user closes the template?
Thanks

"Sheeloo" wrote:

You need to save it once as a 'macro-enabled workbook' in 2007...
I think the type is xlsm... After that you can save the file without getting
this message...

"Gary Nguyen" wrote:

My codes image a table in Office 2003 excel template with macro enable, after
I update to Office 2007, I get this error message on closing the workbook:
The following features cannot be saved in macro-free workbooks:
VB project
To save a file with these features, click No, and then choose a
macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.

Is there a way I can suppress this message programmatically? Or using Office
2007 policy?
It seems that Office 2007 does not allow to save as .xlsx with macro.
Thanks for your help.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Display "macro-free workbooks - VB project message" on closing

Hi Gary

A template will try to save the file in the default format of Excel 2007
You can change the default file format to xlsm(with macros)
See Office ButtonExcel Options...Save

I send a suggestion to MS to always default the save for a template with code as xlsm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Gary Nguyen" wrote in message ...
Thanks for your reply.
But everytime after the user images the template, then he closes this
template, the error message diplays again.
Is there a way, I can default this template to .xlsm (or .xls) on saving
when user closes the template?
Thanks

"Sheeloo" wrote:

You need to save it once as a 'macro-enabled workbook' in 2007...
I think the type is xlsm... After that you can save the file without getting
this message...

"Gary Nguyen" wrote:

My codes image a table in Office 2003 excel template with macro enable, after
I update to Office 2007, I get this error message on closing the workbook:
The following features cannot be saved in macro-free workbooks:
VB project
To save a file with these features, click No, and then choose a
macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.

Is there a way I can suppress this message programmatically? Or using Office
2007 policy?
It seems that Office 2007 does not allow to save as .xlsx with macro.
Thanks for your help.

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"Not enough system resources to display completely" message johney Excel Discussion (Misc queries) 1 May 9th 07 10:44 PM
Excell error "Can't find Project or Library" Project VBAProject Lost in Excel Excel Worksheet Functions 0 April 12th 07 04:42 PM
How to Display "Sorted by..." Message on Printout Harry H. Excel Discussion (Misc queries) 2 January 4th 07 08:48 PM
Error message "Not enough system resources to display completely." MKode Excel Discussion (Misc queries) 1 March 2nd 06 01:00 PM


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