JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old March 27th, 2008, 05:46 AM
tools tools is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 tools User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 0
Exclamation Other - Excel Macro and Javascript

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

Reply With Quote
  #2  
Old April 3rd, 2008, 11:34 PM
tools tools is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 tools User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 20 sec
Reputation Power: 0
Is anybody having any idea how to do this..??? or is it impossible..?

Thanks

Reply With Quote
  #3  
Old April 5th, 2008, 02:30 AM
mecanicu mecanicu is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 110 mecanicu User rank is Private First Class (20 - 50 Reputation Level)mecanicu User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 1 h 50 m 43 sec
Reputation Power: 2
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Other - Excel Macro and Javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway