Solved

Are there html tags for separating worksheets in Excel?

Posted on 2004-04-30
7
4,695 Views
Last Modified: 2013-11-19
I am working on streaming an html table back to the client to be opened in Excel. All is well except I'm wondering if there is a way to insert a workseet separator so that when the html is opened in excel, the workbook appears with multiple sheets. I am not interested in a solution in xml as I would like to be able to easily format the table with html. I'm hoping to do something like the following:

<workbook><worksheet><table><tr><td>123</td></tr></table></worsheet><worksheet><table>><tr><td>123</td></tr></table></worsheet></workbook>

or:

<table><tr><td>123</td></tr></table><workbookseparator></workbookseparator><table><tr><td>123</td></tr></table>

I don't really care what the "workbook separator" looks like, as long as i can get one html table per worksheet. Thank you.
0
Comment
Question by:mhil
7 Comments
 
LVL 4

Expert Comment

by:apprenti
Comment Utility
Are there html tags for separating worksheets in Excel?

No.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
If you are opening in Excel, then HTML has nothing to do with the formatting, the browser is little more than a wrapper for the excell application.

Cd&
0
 
LVL 14

Expert Comment

by:cracky
Comment Utility
Unfortunately, this isn't as simple as you would like :(

Since you mentioned you only want to do this with HTML, the simple answer to your question is as apprenti says: no, it's not possible.

However, there are a heap of server-side solutions for outputting .xls workbooks in native format, which might be your only option. If you aren't familiar with basic server-side programming, then these links might be of no use to you, but worth a try if you are serious about outputting to Excel:

For PHP: http://sourceforge.net/projects/psxlsgen/
For Python: http://sourceforge.net/projects/pyxlwriter/
For Perl: http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.43/
PEAR Implementation: http://www.weberblog.com/Manuals/Pear/package.fileformats.spreadsheet-excel-writer.html
ASP Script: http://www.hotscripts.com/Detailed/15388.html
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 11

Accepted Solution

by:
sciber_dude earned 500 total points
Comment Utility
Please see the solution on this page. This shows how u can create multiple worksheets in the Excel from HTML output.

(it is in a loop)

http://www.experts-exchange.com/Web/Web_Languages/XML/Q_20919841.html

:) SD
0
 

Author Comment

by:mhil
Comment Utility
I guess what I was misleading in saying "Html Tags". What separates the tables is arbitrary. I was just hoping to be able to re-use html components to make life easier for formatting.

SD - the loop you pointed out is just xml output. I was hoping for a solution like the first answer on that page, but I can't seem get multiple tables in one page to each get created in their own worksheets. Any ideas?
0
 

Author Comment

by:mhil
Comment Utility
Ok, I answered my own question. Here is the html output needed:

<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">
 <HEAD>
  <meta name="Excel Workbook Frameset">
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  <meta content="Excel.Sheet" name="ProgId">
  <meta content="Microsoft Excel 11" name="Generator">
  <LINK href="Sheet1.htm">
  <LINK href="Sheet2.htm">
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetSource HRef="Sheet1.htm"/>
   </x:ExcelWorksheet>
   <x:ExcelWorksheet>
    <x:Name>Sheet2</x:Name>
    <x:WorksheetSource HRef="Sheet2.htm"/>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
 </x:ExcelWorkbook>
</xml><![endif]-->
 </HEAD>
 <body>
 </body>
</HTML>

The important thing to note that was missing from similar threads is the "WorksheetSource" and "Link" elements. Basically this output yields a worksheet wrapper page that points to other pages that contain the html tables.
0
 
LVL 11

Expert Comment

by:sciber_dude
Comment Utility
hmm... glad i could help.

Sorry for not giving you the entire answer, but i was not aware of exactly what you wanted. Good luck.

:) SD

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to dynamically set the form action using jQuery.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now