Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to save a backup copy of a macro-created workbook as a CSV. The
workbook has a single sheet. This line fails with a 1004 error: oExcelApp.activeworkbook.SaveAs filename:="L:\aTest\Sent\Trades_" & Format(date, "yyyy-mm-dd"), FileFormat:=xlCSV, CreateBackup:=False Anyone have any ideas? When I try a SaveAs manually I get a dialog -- if this is the problem, how can I avoid this? Maury |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
good bet you are using Late Binding. As such, the constant xlCSV would have
a value of zero when you want to pass a value of 6. So do that explicitly oExcelApp.activeworkbook.SaveAs _ filename:="L:\aTest\Sent\Trades_" & _ Format(date, "yyyy-mm-dd"), _ FileFormat:=6, _ CreateBackup:=False -- Regards, Tom Ogilvy "Maury Markowitz" wrote in message ... I'm trying to save a backup copy of a macro-created workbook as a CSV. The workbook has a single sheet. This line fails with a 1004 error: oExcelApp.activeworkbook.SaveAs filename:="L:\aTest\Sent\Trades_" & Format(date, "yyyy-mm-dd"), FileFormat:=xlCSV, CreateBackup:=False Anyone have any ideas? When I try a SaveAs manually I get a dialog -- if this is the problem, how can I avoid this? Maury |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Geez Tom, I think I'm up to owing you a bottle of something nice by this
point. Name yer poison! (seriously) Maury |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error 1004: Calculate Method of Range Class Failed | Excel Programming | |||
Error 1004 Method 'Add'of Object Sheets failed | Excel Programming | |||
RT Error 1004, Select method of worksheet class failed | Excel Programming | |||
Error 1004: Method 'Cells' of object '_Global' failed | Excel Programming | |||
Error Excel: 1004 SaveAs method of Workbook class failed | Excel Programming |