GlenLynam
MIS
- Jul 26, 2002
- 121
Hi i have the following code...
Set objXL = Excel.Application 'New Excel.Application
objXL.Workbooks.Open ("\\server\shared$\Kitting Department\GSM despatch\GSM Shipments\" & strfilexls)
objXL.Visible = True
objXL.DisplayAlerts = False
objXL.Cells.Select
objXL.Range("G1").Activate
objXL.Replace What:=",", Replacement:=";", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
objXL.ActiveWorkbook.SaveAs FileName:="\\server\shared$\Kitting Department\GSM despatch\GSM Shipments\" & strfilecsv & ".csv", FileFormat:=xlCSV, CreateBackup:=False
objXL.Quit
Set objXL = Nothing
It works fine until you get to the line 'objXL.Replace What:=",", Replacement:=";",' at this point it errors out. t used to work in office xp but i need to get to work on a office 2k machine, an upgrade is out of the question.
I get application-defined or object-defined error. Any help that can be offered will be greatly appreciated.
Thanks
Glen
Set objXL = Excel.Application 'New Excel.Application
objXL.Workbooks.Open ("\\server\shared$\Kitting Department\GSM despatch\GSM Shipments\" & strfilexls)
objXL.Visible = True
objXL.DisplayAlerts = False
objXL.Cells.Select
objXL.Range("G1").Activate
objXL.Replace What:=",", Replacement:=";", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
objXL.ActiveWorkbook.SaveAs FileName:="\\server\shared$\Kitting Department\GSM despatch\GSM Shipments\" & strfilecsv & ".csv", FileFormat:=xlCSV, CreateBackup:=False
objXL.Quit
Set objXL = Nothing
It works fine until you get to the line 'objXL.Replace What:=",", Replacement:=";",' at this point it errors out. t used to work in office xp but i need to get to work on a office 2k machine, an upgrade is out of the question.
I get application-defined or object-defined error. Any help that can be offered will be greatly appreciated.
Thanks
Glen