Hi Bruney,
Thank you for ur immediate reply.
Still I could not open it in multiple sheets. Dont know wtz happening
I have created a ExcelObject and added two sheets.
When am asigning objExcel.HtmlData = strHtml
Its showing only one sheet. The second sheet has been deleted
automatically.
I have tried to asign html to a sheet object, but there is no property
for sheet object.
For more details pls refer the following code. & Pleeease let me know
wtz wrong with my code.
<%
Response.Buffer = True
Response.ContentType="application/vnd.ms-excel"
Dim objExcel
Dim excelSheet, sheetNo, totalSheet
Dim iCompanyID, strCompanyName
Dim strDate
dim iRow,iCol,totCols
Set objExcel= Server.CreateObject("OWC10.Spreadsheet")
sRow = " <html> <head> <title>Test Reports</title> "
sRow = sRow & " </head> <body> <table width=710 border=1
cellspacing=3 cellpadding=3 valign=top> <TR> <TD>CompanyID</TD>
<TD>Company Name</TD> <TD>Stock Exchange</TD> </TR>
<TR>
<TD>8377</TD>
<TD><a href="
http://www.acc.com"> Acc</a></TD>
<TD>Mumbai</TD>
</TR>
<TR>
<TD>8378</TD>
<TD><a href="
http://www.infosys.com">Infosys</a></TD>
<TD>Mumbai</TD>
</TR>
</table> </body> </html> "
objExcel.Sheets.Add
Set excelSheet=objExcel.Worksheets(1)
excelSheet.Activate
objExcel.HTMLData = sRow
' assign to next sheet with a different content
Set excelSheet=objExcel.Worksheets(2)
excelSheet.Activate
'Assign sRow with a different html content and assign to sheet
sRow = " <html> <head> <title>Test Reports</title> "
sRow = sRow & " </head> <body> <table width=710 border=1
cellspacing=3 cellpadding=3 valign=top> <TR> <TD>CompanyID</TD>
<TD>Company Name</TD> <TD>Stock Exchange</TD> </TR>
<TR>
<TD>8377</TD>
<TD><a href="
http://www.wipro.com"> Wipro</a></TD>
<TD>Mumbai</TD>
</TR>
<TR>
<TD>8378</TD>
<TD><a href="
http://www.hexaware.com">Hexaware</a></TD>
<TD>Mumbai</TD>
</TR>
</table> </body> </html> "
objExcel.HTMLData = sRow
objExcel.DisplayToolbar = false
'excelSheet.Activate
objExcel.AutoFit=true
Response.Write objExcel.XMLData
set objexcel=nothing
%>