2
votes

This is a good theory discussion. I have a VBA heavy workbook that pulls information from a database for a specific item. Let's pretend that that item is a sales invoice. The way the workbook works now is that there is a cell in which you put a invoice number then click a refresh button and all the information for that invoice is pulled and munged in the workbook.

Is there a way that, from a command line sorta thing, set the cell with the invoice number to a value then execute the refresh when the workbook is opened? I know that I can fire the refresh macro when the workbook open via VBA, the real question is can I set a cell value to something from outside Excel. The goal is to provide a hyperlink I build that when a user clicks it, the cell value is set then the data refreshed. I am not sure where to look for this answer.

Thank you.

1

1 Answers

0
votes

From reading the link I have included below, it would appeear that you cannot pass command line parameters to excel directly, however, you can use vb script which accepts parameters and then the vb script opens excel and inserts the parameter value

Link to post on MSD