Workbooks.Close
CD is the old DOS command.
ChDir is the VBA command to change directory.
Joel wrote:
I always use
set cd = workbooks.open(filename:=FName)
cd.close Savechanges:=true
Excel might not like CD because it is the command "Change Directory". Try a
different name!
"andim" wrote:
Hi everyone
I have a command button which takes the value of A20, opens another .xls
file and pastes the value in A20 of the new file (the new file has been
assigned to variable cd).
It is then supposed to close and save the new file with the following code:
Workbooks(cd).Close SaveChanges = True
But it doesn't save the changes. I don't know if it is because the command
button is in the first .xls file or not though.
Any Ideas?
--
Dave Peterson
|