Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default ActiveWorkbook.SaveAs in excel 2007

Hi All,
I've have a code that saves a workbook with one sheet to a CSV file.
In 2003 edition there is no problems.
In 2007 I get the 1004 in: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=xlCSV, CreateBackup:=False. where fname is Variant.
I've tried changing the code to: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=6, CreateBackup:=False but still same thing.
I've scanned this forum but no answer did helped yet.
Any thoughts?
Thanks a lot inadvance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default ActiveWorkbook.SaveAs in excel 2007

recording a macro shows this:

ActiveWorkbook.SaveAs Filename:= _
"N:\My Documents\Excel\BP\Blending\BLENDING SCHEDULE9.csv",
FileFormat:=xlCSV _
, CreateBackup:=False

have you tried fname as a string? can you break the code and see the
contents of fname, or do a debug.print after the variable is set?

you could always test for the version

if Application.Version =12.0 then
'execute office 2007 code
else
'execute office 2003 code
end if


probably need to show your code with the variables and path info.
--


Gary

"Lp12" wrote in message
...
Hi All,
I've have a code that saves a workbook with one sheet to a CSV file.
In 2003 edition there is no problems.
In 2007 I get the 1004 in: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=xlCSV, CreateBackup:=False. where fname is Variant.
I've tried changing the code to: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=6, CreateBackup:=False but still same thing.
I've scanned this forum but no answer did helped yet.
Any thoughts?
Thanks a lot inadvance


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default ActiveWorkbook.SaveAs in excel 2007

Thanks Gary.
I'll give it a try

"Gary Keramidas" wrote:

recording a macro shows this:

ActiveWorkbook.SaveAs Filename:= _
"N:\My Documents\Excel\BP\Blending\BLENDING SCHEDULE9.csv",
FileFormat:=xlCSV _
, CreateBackup:=False

have you tried fname as a string? can you break the code and see the
contents of fname, or do a debug.print after the variable is set?

you could always test for the version

if Application.Version =12.0 then
'execute office 2007 code
else
'execute office 2003 code
end if


probably need to show your code with the variables and path info.
--


Gary

"Lp12" wrote in message
...
Hi All,
I've have a code that saves a workbook with one sheet to a CSV file.
In 2003 edition there is no problems.
In 2007 I get the 1004 in: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=xlCSV, CreateBackup:=False. where fname is Variant.
I've tried changing the code to: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=6, CreateBackup:=False but still same thing.
I've scanned this forum but no answer did helped yet.
Any thoughts?
Thanks a lot inadvance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default ActiveWorkbook.SaveAs in excel 2007

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

--

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


"Lp12" wrote in message ...
Hi All,
I've have a code that saves a workbook with one sheet to a CSV file.
In 2003 edition there is no problems.
In 2007 I get the 1004 in: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=xlCSV, CreateBackup:=False. where fname is Variant.
I've tried changing the code to: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=6, CreateBackup:=False but still same thing.
I've scanned this forum but no answer did helped yet.
Any thoughts?
Thanks a lot inadvance

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default ActiveWorkbook.SaveAs in excel 2007

Thanks Ron.
Something very strange, When I hit the macro from ecxel, it's working. When
running in debug mode, I'm ending with 1004 error.
Strange,hah?

"Ron de Bruin" wrote:

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

--

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


"Lp12" wrote in message ...
Hi All,
I've have a code that saves a workbook with one sheet to a CSV file.
In 2003 edition there is no problems.
In 2007 I get the 1004 in: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=xlCSV, CreateBackup:=False. where fname is Variant.
I've tried changing the code to: ActiveWorkbook.SaveAs Filename:=fname,
FileFormat:=6, CreateBackup:=False but still same thing.
I've scanned this forum but no answer did helped yet.
Any thoughts?
Thanks a lot inadvance


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 franks Excel Programming 6 August 6th 07 10:04 PM
Error When using ActiveWorkBook.SaveAs in Excel Anthony[_4_] Excel Programming 2 July 14th 07 04:32 PM
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 J Silver Excel Programming 0 June 25th 04 09:01 PM


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