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" <(E-Mail Removed)> wrote in message
news

33DC5D8-8073-4E30-8EF3-(E-Mail Removed)...
> 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