View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default How to code the Macro to save and close a file?

Why? What happens? What messages do you get?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Eric" wrote in message
...
Thank everyone for suggestions

I try this by typing following codes into Macro,
but the command Save and Close cannot be performed.
Do you have any suggestions on how to fix this?
Thank everyone very much for any suggestions
Eric

"Bob Phillips" wrote:

Set oWB = Workbooks.Open (Filename:="C:\Files\1.xls", _
UpdateLinks:=3)
oWb.Save
oWb.Close

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Eric" wrote in message
...
Workbooks.Open Filename:="C:\Files\1.xls", _
UpdateLinks:=3
ActiveWorkbook.Save
ActiveWindow.Close
The command "ActiveWindow" cannot be performed, does anyone have any
suggestions on how change the code for specific file under specific
directory, such as
Save "C:\Files\1.xls" to replace the code ActiveWorkbook.Save
Close "C:\Files\1.xls" to replace the code ActiveWorkbook.Close

Thank for any suggestions
Eric