Start excel and launch add-in automatically

  • Thread starter Thread starter Dan Christoph
  • Start date Start date
D

Dan Christoph

Hi,

I'm writing an application that exports calculation results into files.
From within my program, I can launch Excel and load that file by passing
its name as a command line argument.

Does anyone know how I can also launch a macro or an add-in through
command line arguments, e.g. to automatically create a chart out of the
data contained in the file? My goal is to have the user click a button
in my application, causing Excel to start and instantly display
calculation results in a chart.

Thanks for your advice,

Dan

** Posted via: http://www.ozgrid.com
Excel Templates, Training, Add-ins & Software!
http://www.ozgrid.com/Services/excel-software-categories.htm **
 
Dan,

Apparently you're not using automation in your application. Rather, you're
launching Excel. Excel's macros live in a workbook (file) and can be
automatically run when the workbook is opened. You could pass the name of
such a workbook file, "My Workbook.xls," which would have a Workbook_Open
macro (runs automatically), which would open your data file, create the
chart, etc. One problem is that if the Excel security level is above Low
(as it should be), the user will get a macro warning saying that the
workbook contains macros, to which the user must answer "Enable macros").
For questions about Excel charts and related macro coding, post in
microsoft.public.excel.charting. If Jon Peltier is still there (the
resident charting goo-roo, bar none), you're in good shape. If not, you're
probably still in OK shape.
 
Back
Top