L
lcoreyl
I am trying to have code in book1:
sub stuff
'blah blah blah
workbooks.open (book2)
Range("A1").value = "open1"
workbooks.saveas (book2newname)
workbooks(book1).activate
workbooks(book1).close
end sub
code in book2:
private sub workbook_activate
if range("A1").value <> "open1" then exit sub
msgbox("it worked!!")
end sub
The point is that I have code that I want triggered in book2, but onl
after I open it and save it to a new name, and close book1.
This doesn't work, but if I take out the close line of code in book1
and then close book1 manually it works? Why won't this trigger when V
closes book1?
sub stuff
'blah blah blah
workbooks.open (book2)
Range("A1").value = "open1"
workbooks.saveas (book2newname)
workbooks(book1).activate
workbooks(book1).close
end sub
code in book2:
private sub workbook_activate
if range("A1").value <> "open1" then exit sub
msgbox("it worked!!")
end sub
The point is that I have code that I want triggered in book2, but onl
after I open it and save it to a new name, and close book1.
This doesn't work, but if I take out the close line of code in book1
and then close book1 manually it works? Why won't this trigger when V
closes book1?