Hi there I've been trying to code a macro to save a workbook on close. and then open a workbook on My Documents and update data.
E.G.
Book1; data is inputted to cells.
Click button
on button click
close document
save changes
open Book2
update data links
This is the VB code I have so far;
Private Sub CommandButton1_Click()
ActiveWorkbook.Save
ActiveWindow.Close
'Refers to Book1
Workbooks.Open Filename:= _
"C:\Users\Documents\Book2.xls", _
UpdateLinks:=0
Windows("Book2").Activate
End Sub
However when I run the macro it only closes the first sheet and does not open the second.
Please help.
Bookmarks