How to Save an Excel file using VBA

  • Thread starter Thread starter suraj.jaldu
  • Start date Start date
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
 
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)
 

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

Back
Top