Changing the name of a Workbook??

D

Don

Hi All,

Is it possible, with VBA, to change the name of a workbook?
I know you can use the saveas function to do this, but I
would like to make the change without saving the file,
then print the file and then, depending on whether the
printed copy was acceptable or not, save the file. I've
got it all working except the name-change....any help
would be appreciated.

Don
 
D

Dave Peterson

The name of a workbook comes when you save it.

Maybe you could use .savecopyas within your macro.

Then if the printed copy is ok, keep that workbook--if it's not ok, look at Kill
(in VBA's help) to delete it.

But if you use .savecopyas, you actually save a copy of the workbook you're
working in--the workbook that you're in doesn't change and isn't saved.

If you want, you can open that .savecopyas file, but if you don't open it, it's
just sitting there on disk.
 

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