Save File As

J

Jeff

C:\Import Data\exceldr.dat

Can someone help me with code to do the following with the
file above:

Open exceldr.dat with Excel
Save File as a spreadsheet (exceldr.xls) in the same
location
Close Excel.

VBA code is not my specialty so any help is greatly
appreciated.
 
S

SA

Dim objXL as Object
Dim objBook as Object

Set objXL = CreateObject ("Excel.Application")
Set objBook = ObjXL.Workbooks.Open(strTargetFile)
objBook.SaveAs strNewFileName
Set objBook = Nothing
objXL.Quit
Set objXL=Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top