Opening Workbook Using Notepad (VBA)

MistakesWereMade

Board Regular
Joined
May 22, 2019
Messages
103
I currently open a workbook using code written on a notepad file. However, the userform that pops up has disabled features it seems... For one, my userform has a combobox that allows me to open other excel files when selected, but when using the notepad, this feature is disabled. Instead, I must manually reveal the workbook that I would like hidden, after which the userform opened file will then pop up. It seems like the notepad suppresses all excel files from opening when I would like for the active workbook to stay closed and any newly opened ones to show. If I open the workbook manually without the notepad file, the userform works the way I want it to.

Any ideas on what could be happening and how to fix this?

My code in my notepad file is listed below.

Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\MyUser\Desktop\Folder\Operations.xlsm")
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I want to get rid of the excel loading prompt at the beginning of opening an excel file. I also want to create a shortcut to my notepad so that I can make my own icon.
 
Upvote 0
if you create a shortcut for your Excel you can change the load by adding "/e" (forward slash e) to suppress the loading screen, and you can change the ICON on your shortcut to whatever you wish

"excel.exe /e C:\...\operations.xlsm"
 
Upvote 0
Genius! Thanks! I did some snooping around command line arguments and found that changing the "target" box in the properties window of my custom shortcut to the line below got it working!

"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE" /e "C:\Users\MyUser\Desktop\Folder\My Excel File.xlsm"

Thanks again for your help CharlesChuckieCharles!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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