Yes,
It will give the Macro warning which has to be there to alert the
user that there could be malicious code in the file. You can use the
Workbook_Open or WorkBook_Activate events to run your code.
An example, Copy and paste this into a new workbook,
Highlight and copy the code below,
Open a new workbook,
Hit Alt and F11,
Double click ThisWorkboook on the left of the screen,
Paste.
Private Sub Workbook_Activate()
Sheet1.Range("A1").Value = "An Example"
End Sub
Save the file, close and re-open it,
Look at Sheet1, A1
Regards,
Alan.