I need to run one VBA code automatically once computer starts without any manual intervention.
Can you please assist me,
Thank you.
Running a VBA code when computer starts
-
- Lounger
- Posts: 27
- Joined: 24 Jun 2020, 01:39
-
- Administrator
- Posts: 78457
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Running a VBA code when computer starts
Try the following:
Create an Excel workbook.
Create a macro that you want to be run automatically.
Create the following code in the ThisWorkbook module of this workbook:
where MyMacro is the name of the macro that you created.
Save the workbook as a macro-enabled workbook (*.xlsm) in your Startup folder
C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
where <username> is your Windows logon name.
Create an Excel workbook.
Create a macro that you want to be run automatically.
Create the following code in the ThisWorkbook module of this workbook:
Code: Select all
Private Sub Workbook_Open()
Call MyMacro
End Sub
Save the workbook as a macro-enabled workbook (*.xlsm) in your Startup folder
C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
where <username> is your Windows logon name.
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 27
- Joined: 24 Jun 2020, 01:39
Re: Running a VBA code when computer starts
Thanks a lot, Hans