ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveWorkbook.SaveAs (https://www.excelbanter.com/excel-programming/394898-activeworkbook-saveas.html)

FrankS

ActiveWorkbook.SaveAs
 
I have transfered from Office 2005 to 2007 Excel Macros which have now
stopped working on the "ActiveWorkbook.SaveAs" line. I have started getting
the infamous "Error 1004." The whole line is highligted, which leads me to
believe that the start of the line is the problem. I include the line as in
Macro, with the exception that the "My Documents" on to the underscore would
be on one line:

ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
Documents\transfer\ftproot\aartfile.xls", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Any help will be deeply appreciated.

Ron de Bruin

ActiveWorkbook.SaveAs
 
Check out this page Frank
http://www.rondebruin.nl/saveas.htm


--

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


"franks" wrote in message ...
I have transfered from Office 2005 to 2007 Excel Macros which have now
stopped working on the "ActiveWorkbook.SaveAs" line. I have started getting
the infamous "Error 1004." The whole line is highligted, which leads me to
believe that the start of the line is the problem. I include the line as in
Macro, with the exception that the "My Documents" on to the underscore would
be on one line:

ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
Documents\transfer\ftproot\aartfile.xls", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Any help will be deeply appreciated.


Jim Rech

ActiveWorkbook.SaveAs
 
Excel 2007 does not support this format: FileFormat:=xlExcel9795. You
should use: xlWorkbookNormal (.xls) or xlWorkbookDefault (.xlsx) or
xlOpenXMLWorkbookMacroEnabled (.xlsm).
--
Jim
"franks" wrote in message
...
|I have transfered from Office 2005 to 2007 Excel Macros which have now
| stopped working on the "ActiveWorkbook.SaveAs" line. I have started
getting
| the infamous "Error 1004." The whole line is highligted, which leads me
to
| believe that the start of the line is the problem. I include the line as
in
| Macro, with the exception that the "My Documents" on to the underscore
would
| be on one line:
|
| ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
| Documents\transfer\ftproot\aartfile.xls", _
| FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
|
| Any help will be deeply appreciated.



[email protected]

ActiveWorkbook.SaveAs
 
On Aug 6, 12:53 pm, "Jim Rech" wrote:
Excel 2007 does not support this format: FileFormat:=xlExcel9795. You
should use: xlWorkbookNormal (.xls) or xlWorkbookDefault (.xlsx) or
xlOpenXMLWorkbookMacroEnabled (.xlsm).
--
Jim"franks" wrote in message

...
|I have transfered from Office 2005 to 2007 Excel Macros which have now
| stopped working on the "ActiveWorkbook.SaveAs" line. I have started
getting
| the infamous "Error 1004." The whole line is highligted, which leads me
to
| believe that the start of the line is the problem. I include the line as
in
| Macro, with the exception that the "My Documents" on to the underscore
would
| be on one line:
|
| ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
| Documents\transfer\ftproot\aartfile.xls", _
| FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
|
| Any help will be deeply appreciated.


Is there any way to do the equivalent of #ifdef (a preprocessor
directive) in VBA to check to see if xlExcel8 (56) is defined? I
don't like having to hack all the constants if I can set at the top of
my sub or in a public module the check for application version and
define xlExcel8 (if it doesn't already exist) as xlWorkbookNormal.
Then, for backwards compatibility, I only have to use xlExcel8.

Any thoughts would be greatly appreciated.


FrankS

ActiveWorkbook.SaveAs
 

Ok. Thanks for the help. fs
"Jim Rech" wrote:

Excel 2007 does not support this format: FileFormat:=xlExcel9795. You
should use: xlWorkbookNormal (.xls) or xlWorkbookDefault (.xlsx) or
xlOpenXMLWorkbookMacroEnabled (.xlsm).
--
Jim
"franks" wrote in message
...
|I have transfered from Office 2005 to 2007 Excel Macros which have now
| stopped working on the "ActiveWorkbook.SaveAs" line. I have started
getting
| the infamous "Error 1004." The whole line is highligted, which leads me
to
| believe that the start of the line is the problem. I include the line as
in
| Macro, with the exception that the "My Documents" on to the underscore
would
| be on one line:
|
| ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
| Documents\transfer\ftproot\aartfile.xls", _
| FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
|
| Any help will be deeply appreciated.




FrankS

ActiveWorkbook.SaveAs
 

Thanks, Ron. I will check it out! fs
"Ron de Bruin" wrote:

Check out this page Frank
http://www.rondebruin.nl/saveas.htm


--

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


"franks" wrote in message ...
I have transfered from Office 2005 to 2007 Excel Macros which have now
stopped working on the "ActiveWorkbook.SaveAs" line. I have started getting
the infamous "Error 1004." The whole line is highligted, which leads me to
believe that the start of the line is the problem. I include the line as in
Macro, with the exception that the "My Documents" on to the underscore would
be on one line:

ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
Documents\transfer\ftproot\aartfile.xls", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Any help will be deeply appreciated.



FrankS

ActiveWorkbook.SaveAs
 
It works on my Macro. I substituted your suggestion (8 instead of 56), into
the line,
".....FileFormat:=xlExcel8, xxxxxx." It at least allows me to keep the code
mostly the same! Thanks!

fs

" wrote:

On Aug 6, 12:53 pm, "Jim Rech" wrote:
Excel 2007 does not support this format: FileFormat:=xlExcel9795. You
should use: xlWorkbookNormal (.xls) or xlWorkbookDefault (.xlsx) or
xlOpenXMLWorkbookMacroEnabled (.xlsm).
--
Jim"franks" wrote in message

...
|I have transfered from Office 2005 to 2007 Excel Macros which have now
| stopped working on the "ActiveWorkbook.SaveAs" line. I have started
getting
| the infamous "Error 1004." The whole line is highligted, which leads me
to
| believe that the start of the line is the problem. I include the line as
in
| Macro, with the exception that the "My Documents" on to the underscore
would
| be on one line:
|
| ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Frank\My
| Documents\transfer\ftproot\aartfile.xls", _
| FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
| ReadOnlyRecommended:=False, CreateBackup:=False
|
| Any help will be deeply appreciated.


Is there any way to do the equivalent of #ifdef (a preprocessor
directive) in VBA to check to see if xlExcel8 (56) is defined? I
don't like having to hack all the constants if I can set at the top of
my sub or in a public module the check for application version and
define xlExcel8 (if it doesn't already exist) as xlWorkbookNormal.
Then, for backwards compatibility, I only have to use xlExcel8.

Any thoughts would be greatly appreciated.




All times are GMT +1. The time now is 02:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com