Thread: Workbooks.Close
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Workbooks.Close

Hard to comment only seeing the one line of code but that line you posted is
not correct. You are missing the colon.

Workbooks(cd).Close SaveChanges:= True

So that line you posted will not even execute... Perhpas post all of your
code so we can see what is going on...
--
HTH...

Jim Thomlinson


"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?