Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey
I want to run excel macro from Javascript code. I find run method in VB but when I tried the given statement in Javascript code, it's giving error: already I have opened that particular excel which has macro.
Excel.Run(Macro name,null)

As macro don't require any parameter that's why I pass null in it.

If I write:
Excel.Run(Macro name)

It again gives me an error.

Please, can anyone help me?
Thanks in advance.
Posted
Updated 13-Mar-11 3:08am
v2

AFAIK, you cannot run anything in Excel from Javascript: that would require giving the webpage access to the Client software and data.

Not a good idea - you can see what use would be made of it by the script kiddies.
 
Share this answer
 
yeah i have found that we can run excel macro from javascript very easily. The code is
MIDL
Excel.Workbooks.Open(file path name);
 Excel.Visible = true;


Excel.Run(macro name);

here "macro name" means full name of macro for example if macro is in excel file named as Book1.xls and in the Module1 and let say macro name is Test so we will write as
C++
Excel.Run("Book1.xls!Module1.Test)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900