Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open an excel document from HTML

Posted on 2004-08-11
9
Medium Priority
?
242 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 1000 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 1000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

715 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