We help IT Professionals succeed at work.

Open an Excel file using "Send To" in File Exporer and passing along file name

I have an Excel 2019 spreadsheet macro that has some VBA in it.  Ideally what I would like is

  1. for a user to right-click a file in Windows Explorer (Windows 10) and select "Send to" and have the Spreadsheet available from the "Send to" menu.  Then, when the spreadsheet opens, it gets the name of the file and Autoruns using that file name in the VBA code
  2. Or, if the spreadsheet is opened without the "Send to" method, it will not autorun

Is this possible, and if so, please help...
Comment
Watch Question

Commented:

To get to the SendTo folder, you’ll need to open up an Explorer window, and then paste in the following to the address bar.

shell:sendto

take a look at the others , you ll have an idea how to implement a new item.

for the vba code aka macro thing, i doubt you can find a way to run it without user prompt for security purposes.

 

Fabrice LambertConsulting
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:

I dont think that's doable, as neither the Application nor the Workbook objects offer a way to retrieve the command line.

Author

Commented:
Thank you both!