Solved

Open an excel document from HTML

Posted on 2004-08-11
9
240 Views
Last Modified: 2008-02-01
I am using a dialog box to write some data in TSV format (Tab Separated Value).  

I would like my diaglog box to open in MS Excel.

How do I do this?
Thank you!!!
John
0
Comment
Question by:JohnTirone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 7

Expert Comment

by:mark-b
ID: 11775933
Example:

excel.html :

<html>
 <body>
  <a href="excel.xls" target="_blank" >go to excel</a>
 </body>
</html>

excel.xls :

1       2       3       4       5
6       7       8       9       10

This will open the TSV file in excel.

-Mark
0
 
LVL 3

Expert Comment

by:alskdj80
ID: 11793277
some browsers may have problems opening the .xls, it might be good to set the MIME ContentType to
<mime type="application/vnd.ms-excel"> just to be safe
0
 

Author Comment

by:JohnTirone
ID: 11811677
Ok, I had already gotten that far, but what I really want to have happen is instead of opening MS Excel within the browser itself, is to have MS Excel (the application) open, not within the browser window.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JohnTirone
ID: 11812191
I guess another way to look at this question:  How do I remove the address line?
0
 

Author Comment

by:JohnTirone
ID: 11822684
Ok,

I figured out what my problem was.
1.      Open control panel
2.      Open folder options
3.      In the folder options window, scroll down & select XLS, then click advanced
4.      make sure the “Browse in same window” is NOT CHECKED.

THIS i combination with setting the mime type opens excel it the application vs. the browser window.

Now, is there another way to do this without me going into control panel?

0
 
LVL 31

Accepted Solution

by:
seanpowell earned 250 total points
ID: 11965285
Hi John,

Here's one option for you, although this is preferable for an intranet becasue of ActiveX

<html>
<head>
<script language="VBScript">
Dim objExcel

Sub Btn1_onclick()
      call OpenWorkbook("file:///E:/myfile.xls")
End Sub

Sub OpenWorkbook(strLocation)

Set objExcel = CreateObject("Excel.Application")
      objExcel.Visible = true
      objExcel.Workbooks.Open strLocation
      objExcel.UserControl = true
End Sub

</script>
</head>
<body>

<a href="#" name="Btn1">Open Workbook</a>

</body>
</html>



Note:
The url could either be:

OpenWorkbook("\\server\share\folder\myfile.xls")
OpenWorkbook("d:\folder\myfile.xls")

Thanks,
Sean
0
 
LVL 2

Assisted Solution

by:cheyennejk
cheyennejk earned 250 total points
ID: 11974199
USE XML tags to convert HTML tables into Excel tables and open as .xls in a new window.
 Here is an example:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetOptions>
     <x:Selected/>
     <x:Panes>
      <x:Pane>
       <x:Number>3</x:Number>
       <x:ActiveRow>2</x:ActiveRow>
       <x:ActiveCol>2</x:ActiveCol>
      </x:Pane>
     </x:Panes>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet2</x:Name>
    <x:WorksheetOptions>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet3</x:Name>
    <x:WorksheetOptions>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
  <x:WindowHeight>9090</x:WindowHeight>
  <x:WindowWidth>15180</x:WindowWidth>
  <x:WindowTopX>120</x:WindowTopX>
  <x:WindowTopY>15</x:WindowTopY>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
 </x:ExcelWorkbook>




<body link=blue vlink=purple>

<table x:str border=0 cellpadding=0 cellspacing=0 width=192 style='border-collapse:
 collapse;table-layout:fixed;width:144pt'>
 <col width=64 span=3 >
 <tr height=17 style='height:12.75pt'>
  <td height=17 width=64 ></td>
  <td width=64 style='width:48pt'></td>
  <td width=64 style='width:48pt'></td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 colspan=3 ></td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 align=right  >HELLO</td>
  <td align=right >HI</td>
  <td align=right >GOOD BYE</td>
 </tr>
 </table>
</body>
</html>



0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Validating number not work with decimal 4 46
A responsive image gallery using flexbox 6 80
CSS for Popup in ASP.NET 4 49
Doubt with angularJs with PHP 4 22
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question