View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Run a batch file from Excel

Where is the line of code that does

ActiveWorkbook.SaveAs Filename:="\\zapad01\sapinter\GPS" _
& res & ".PRN", _
FileFormat:=xlTextPrinter, CreateBackup:=False
ActiveWindow.Close
OldName = "\\zapad01\sapinter\GPS" & res & ".PRN"
NewName = "\\zapad01\sapinter\GPS" & res & ".DAT"
name Oldname to NewName

anyway, just naming it DAT from the start worked for me:


ActiveWorkbook.SaveAs Filename:="\\zapad01\sapinter\GPS" _
& res & ".DAT", _
FileFormat:=xlTextPrinter, CreateBackup:=False

--
Regards,
Tom Ogilvy




"Tempy" wrote in message
...
Hello Bob,

I have tried using the code below but it does not work ?
Could you please heeeelp ?
The code runs, but does not change the ".PRN to ".DAT"

ChDir "\\zapad01\sapinter"
ActiveWorkbook.SaveAs Filename:="\\zapad01\sapinter\GPS" & res &
".PRN", _
FileFormat:=xlTextPrinter, CreateBackup:=False
ActiveWindow.Close
OldName = "\\zapad01\sapinter\GPS" & res & ".PRN": NewName = _
"\\zapad01\sapinter\GPS" & res & ".DAT"


Tempy

*** Sent via Developersdex http://www.developersdex.com ***