Workbook Open Event Procedure

V

Vijay Chary

Hi !! :)
Could someone tell me if it is possible to work with another
workbook from a workbook open event procedure !

Thank you !! :)
 
J

JLGWhiz

The Workbook_Open() event procedure will only fire from the workbook the
procedure is in. However, you can put code in that procedure that will
return values from another workbook, execute code in another workbook, etc.

Private Sub Workbook_Open()
Set wb2 = Workbooks.Open("C:\MyDocuments\myFile.xls")
wb2.Sheets(1).Range("A1") = "Hello There"
MsgBox wb2.Sheets(1).Range(A1").Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top