|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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:
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. |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Opening specific .xls file with javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|