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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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