LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Creating macro enabled Excel 2007 workbook

This saves an .xlsm file on my desktop

Option Explicit
Sub Test()
Dim myWB As Excel.Workbook
Dim myFolder As String


Set myWB = Workbooks.Add
myFolder = "C:\Documents and Settings\" & _
Environ("USERNAME") & "\Desktop\"
myWB.SaveAs myFolder & "BarbsFile.xlsm", FileFormat:=52


End Sub

In Excel 2007, you need to include the FileFormat. Read this from Ron de
Bruin

http://www.rondebruin.nl/saveas.htm

HTH,
Barb Reinhardt

"Ken Warthen" wrote:

I need to create a macro enabled Excel 2007 workbook from a routine in
another workbook. I've tried using the workbook.add method but it does not
support the macro enabled file type or xlsm extension. Any help is always
greatly appreciated.

Ken

 
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 Macro-enabled Workbook Salza Excel Discussion (Misc queries) 2 May 16th 10 03:57 AM
Excel 2007-macro enabled, multi-sheet opening in minimized mode LT Excel Discussion (Misc queries) 0 March 11th 10 05:36 PM
Error when opening a macro-enabled Excel 2007 file JRSCEI Excel Discussion (Misc queries) 0 January 11th 10 08:55 PM
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Default a workbook to save as a xlsm (macro-enabled) in 2007 Razzer204 Excel Discussion (Misc queries) 3 March 21st 07 06:10 PM


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