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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old November 21st, 2005, 04:11 PM
karen99 karen99 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 3 karen99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 57 sec
Reputation Power: 0
Opening specific .xls file with javascript

Hi: I am attempting to open an Excel worksheet from within my HTML script. I was able to open it using vbscript, but am having trouble with the javascript version...

code I am using in the HEAD:
==================================
<script language=javascript>

function startExcel(strFile)
{
var myApp = new ActiveXObject("Excel.Application");
if (myApp != null)
{
myApp.Visible = true;
myApp.Workbooks.Open(strFile);
}
}

</script>

code I'm using in the BODY:
==============================================
<li id="toplevel"><a href="javascript: startExcel('http://myDirectory/test.xls')" style="cursor: pointer;">My Report</a></li>
===============

any ideas out there?

thanks ahead of time for your help,

Karen

Reply With Quote
  #2  
Old November 21st, 2005, 06:13 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 536 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 1 h 11 m
Reputation Power: 3
file path

Hi karen99, welcome to the forums,
You did not give the error message, but I'm guessing the problem has something to do with the path. You posted
Quote:
'http://myDirectory/test.xls'

If the files are on your computer, the path should be something like
Code:
'C:/myDire~1/test.xls'

Perhaps "myDirectory" would work too, but windows truncates names to 8 characters. Right-click - properties to see the "ms-dos" name.

Reply With Quote
  #3  
Old November 22nd, 2005, 11:47 AM
karen99 karen99 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 3 karen99 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 57 sec
Reputation Power: 0
Thanks for the tip....

Thx for the tip!

I'm pretty new to Javascript, and am now adding "try", "catch" statements to my code to narrow down the exact error....my actual directory is different than the one I included in my msg (but has some words that are more than 8 characters....)

karen

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Opening specific .xls file with 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 | 
  
 

Iron Speed




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