Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.


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
ActiveWorkbook.SaveAs Returns BHatMJ Excel Programming 3 May 19th 07 02:31 AM
ActiveWorkbook.SaveAs problem SandyUK[_11_] Excel Programming 2 November 14th 05 02:54 PM
'ActiveWorkbook.SaveAs Filename' TOMB Excel Programming 2 February 15th 05 11:51 PM
ActiveWorkbook.SaveAs Problem SowBelly Excel Programming 4 August 4th 04 10:58 PM
activeworkbook.saveas J Silver Excel Programming 0 June 25th 04 09:01 PM


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