2

I have an Excel VBA script that is in .xlsm format. Once the file is opened, a window pops up asking you to "Browse" for file and provide the address to the file in a text box.

I want to run this .xlsm file from cmd and provide the path argument to it from cmd as well.

How can I do this?

This opens the file:

EXCEL.EXE /e "c:\converter.xlsm"

But I cannot figure out how to pass a path argument and hit the submit button all from cmd.

sasuwokefi
  • 21
  • 2
  • 1
    Check out this post here on StackOverflow. it explains it all https://stackoverflow.com/questions/31405654/passing-arguments-from-command-line-in-excel-2010 – Yuri Pustjens Nov 20 '17 at 08:43

1 Answers1

0

xlsm files can only be opened by excel and VBA stants for visual basic for applications, you can write Visual Basic script and execute it from dos prompt (.vbs files ) also more information on the issue is on microsoft technet library on vb script