|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Hi
I am able to open an excel sheet using javascript and now i want a macro to run as soon as the excel sheet is opened. I have used Auto_Open() and it runs fine when i open the excel sheet manually but when i open the sheet using javascript the macro does not run at all. Here is the javascript code i have written to open the excel file. function openExcel(){ var Excel; // Declare the variables Excel = new ActiveXObject("Excel.Application"); Excel.Workbooks.Open("C:/Final templates/MyExcel.xls"); Excel.Visible = true; } Is there a way to run this macro..? Thanks ![]() |
|
#2
|
|||
|
|||
|
Is anybody having any idea how to do this..??? or is it impossible..?
Thanks |
|
#3
|
|||
|
|||
|
It is quite possible.
From VBA for Excel Helper: Code:
With ActiveWorkbook
.RunAutoMacros xlAutoOpen
.Close
End With
This piece of code must be placed in your workbook code all the best Last edited by mecanicu : April 5th, 2008 at 02:34 AM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Other - Excel Macro and Javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|