G
GEORGIA
hi,
I'm tyring to run this code I've gotten from Excel forum in Access
I've added MS Excel 11.0 Object Libray and VBA in reference but still no luck
it gives an error saying "test.xls" was not found but it is there.
Run-time error 1004
Thank you for your help.
Excel.Application.DisplayAlerts = False
Dim FName As String
Dim WB As Workbook
ChDrive "C"
ChDir "C:\MY Documents"
FName = Dir("*.xls")
Do Until FName = ""
Set WB = Workbooks.Open(Filename:=FName)
WB.SaveAs Filename:=Replace(FName, ".xls", ".csv"), FileFormat:=xlCSV
WB.Close savechanges:=True
FName = Dir()
Loop
I'm tyring to run this code I've gotten from Excel forum in Access
I've added MS Excel 11.0 Object Libray and VBA in reference but still no luck
it gives an error saying "test.xls" was not found but it is there.
Run-time error 1004
Thank you for your help.
Excel.Application.DisplayAlerts = False
Dim FName As String
Dim WB As Workbook
ChDrive "C"
ChDir "C:\MY Documents"
FName = Dir("*.xls")
Do Until FName = ""
Set WB = Workbooks.Open(Filename:=FName)
WB.SaveAs Filename:=Replace(FName, ".xls", ".csv"), FileFormat:=xlCSV
WB.Close savechanges:=True
FName = Dir()
Loop