Auto_Open problem

  • Thread starter Thread starter LB79
  • Start date Start date
L

LB79

I have a workbook that runs a macro when it opens - this works fine bu
when i open this workbook through another excel workbook the Auto_Ope
doesnt run. The code in the linked workbook is below. Does anyone kno
what im doing wrong?

Private Sub CommandButton1_Click()
If Dir("C:\Workbook2.xls") <> "" Then
Workbooks.Open "C:\Workbook2.xls"
ElseIf Dir("C:\Workbook2.xls") <> "" Then
Workbooks.Open "C:\Workbook2.xls"
Else
Workbooks.Open "C:\Workbook2.xls"
End If
Application.ScreenUpdating = False
Windows("Workbook1.xls").Activate
Application.StatusBar = False
ActiveWindow.Close
End Su
 
Hello
Workbooks.Open "C:\Workbook2.xls"
ActiveWorkbook.RunAutoMacros xlAutoOpen
HTH
Cordially
Pascal
 

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

Back
Top