Web Development

General discussion


Excel Macro From an ASP webpage

By horacio.garcia ·
Hi guys i am trying to open and display excel file, and run a macro that accepts parameters.

I've tried all i can think of, creating and object and it just does not work.

So now i am opening the file witha normal hyperlink, but how can i run a macro that needs to recieve paramaters.

can you guys help out

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Juergen Hartl In reply to Excel Macro From an ASP w ...

Set ex = server.CreateObject("Excel.Application")
Set wbs = ex.Workbooks
wbs.Open( path/to/excelworkbook.xls)
ex.Run "Makroname"

Collapse -

by bschaettle In reply to Excel Macro From an ASP w ...

This is actually a little-known "feature" but it works. Instead of hyperlinking directly to the Excel file, hyperlink to a Windows SHORTCUT that points to the Excel file. This will cause the file to be opened using the Excel application instead of the Excel Viewer.

<a href="javascript:var w=window.open('Excel_folder\MyexcelShortcut.LNK');">click here</a>

Related Discussions

Related Forums