Noivilbo
04-30-2010, 12:57 AM
Hi Guys,
I'm quite new to VBA, and I couldn't find the solution for the following problem;
I would like to create a new workbook with vba, move a sheet to the new workbook and then save it as a macro-enabled workbook.
I tried the following code:
Dim Newbook As Workbook
Set Newbook = Workbooks.ADD
Newbook.SaveAs Filename:="C:\Documents and Settings\" & Naamoud, FileFormat:=xlOpenXMLWorkbookMacroEnabled
I guess that the problem is that the Fileformat property is a read-only property?
In my variable "Naamoud", I have tried both with and without adding the ".xlsm", and I can't get it to work properly.
Thx in advance
I'm quite new to VBA, and I couldn't find the solution for the following problem;
I would like to create a new workbook with vba, move a sheet to the new workbook and then save it as a macro-enabled workbook.
I tried the following code:
Dim Newbook As Workbook
Set Newbook = Workbooks.ADD
Newbook.SaveAs Filename:="C:\Documents and Settings\" & Naamoud, FileFormat:=xlOpenXMLWorkbookMacroEnabled
I guess that the problem is that the Fileformat property is a read-only property?
In my variable "Naamoud", I have tried both with and without adding the ".xlsm", and I can't get it to work properly.
Thx in advance