SaveAs syntax when using a variable

K

Keith

I need to save a file as read-only recommended. My file
name is stored in a variable, strSaveFile.

I can't get the SaveAs method to work correctly.

What I have:

exlSheet.SaveAs(strSaveFile,,,,True,,,,)
- True for read-only recommended.

This give me a compiler error.

What is the correct syntax?

Thanks
 
T

Trevor Shuttleworth

Keith

lose the brackets:

exlSheet.SaveAs strSaveFile, , , , True

Note though that Save and SaveAs relate to the workbook rather than a
worksheet. Your object gives the impression that you might be trying to
save a sheet. Just something to bear in mind.

Regards

Trevor
 

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