How to Save an Excel file using VBA

S

suraj.jaldu

Hi All,

I have a tool called "TestPartner" which uses VBA to test the
applications.
My application opens an Excel file after submitting the data. Now,
using the VBA in TestPartner I have to save that file.

Following is the code written by me.
Dim myExc As Object
Dim myWb As Workbook

Set myExc = CreateObject("Excel.Application")
Set myWb = Excel.ActiveWorkbook

myWb.SaveAs ("Path")

but this is not working.
Please let me know how to save the Excel file which is already opened
using VBA.

Thanks,
Suraj
 
B

Bob Phillips

maybe

Dim myExc As Object
Dim myWb As Workbook

Set myExc = CreateObject("Excel.Application")
Set myWb = myExc .ActiveWorkbook

myWb.SaveAs "Path"

is Path the name you want to save it as?


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top