Problem in exporting to csv


G

glenn

hi all


I wanted to export a workbook (it has only one worksheet) to a csv file,
so I used this code:


ActiveWorkbook.SaveAs Filename:= "c:\aFile.csv", FileFormat:=xlCSV
,CreateBackup:=False

It works fine, but after I run it i find myself working in Excel within
the aFile.csv file instead of the initial aFile.xls.

How can I export to the csv while remaining inside the xls after the export?

Thanks!
 
Ad

Advertisements

G

Guest

After exporting,

ActiveWorkbook.SaveAs FileName:=X, _
FileFormat:=xlCSV, CreateBackup:=False
ActiveWindow.Close , savechanges:=False

Then you would be where you were before you added this workbook. But if you
must go someplace else, you could explicitly return somewhere else:

Windows("FirstFile.xls").Activate
 

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