Macro Auto_open won't run if excel opened from another macro. Please help.

sammpa

New Member
Joined
Jun 18, 2018
Messages
4
Hi there.

I have an Excel "Blank Rate request Form" that enters today's date in one cell and the identified user in another cell.

It is housed on a shared drive (R:) for others to use. If anyone opens that folder and opens the Excel the above macro works fine.

Sub Auto_open()

Range("username") = Environ("username")
ActiveSheet.Unprotect
Range("DATEINPUT").Value = Date
Range("AHCMINPUT").Select
ActiveSheet.Protect

End Sub

However, if the file is opened from a button on another workbook, the auto_open doesn't run.

I have popped a "RESET FORM" button on the "Route Request" form which runs the same code for now.

My question, if you haven't gathered, is how can I make that code run or force the auto_open to work if opening the sheet from a macro button on another workbook?

This is the code that opens the sheet:

Sub ZBU_Route_Request
'
' ZBU_Route_Request Macro
'

'
Workbooks.Open Filename:-="R:\GB Routes\Blank Rate request Form.xlsm", _
UpdateLinks:=0

End Sub

Any help would be appreciated.

Many thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top