Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Export to Excel using XML

Status
Not open for further replies.

HersheyCruiser

Programmer
Aug 28, 2003
1
US
I am attempting to create an Excel spreadsheet with multiple worksheets from a Web app using VBScript and XML. The following code within an ASP page successfully create the spreadsheet with the worksheets, but the data which should be loaded from the asp pages specified in the data islands (worksheetsource) is not loading. All the ASP pages are located in the same directory. It appears that when this page is loaded (server side), the worksheetsource parameters are not being resolved. Anyone care to offer some advice?

<%@ Language=VBScript %>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;
<html xmlns:eek:=&quot;urn:schemas-microsoft-com:eek:ffice:eek:ffice&quot;
xmlns:x=&quot;urn:schemas-microsoft-com:eek:ffice:excel&quot;
xmlns:ss=&quot;urn:schemas-microsoft-com:eek:ffice:spreadsheet&quot;
xmlns=&quot;<%
Response.Expires=0 ' prevent caching
Response.Buffer=True
server.ScriptTimeout = 120
Response.ContentType = &quot;application/vnd.ms-excel&quot;
%>
<head>
<meta http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;>
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content=&quot;Microsoft Excel 9&quot;>

<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Income Totals</x:Name>
<x:WorksheetSource HREF='IncomeTotals.asp'/>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>TaxPayer K1's</x:Name>
<x:WorksheetSource HREF='K1Totals.asp'/>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>Secondary K1's</x:Name>
<x:WorksheetSource HREF='SecondaryTotals.asp'/>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>8835</x:WindowHeight>
<x:WindowWidth>15180</x:WindowWidth>
<x:WindowTopX>120</x:WindowTopX>
<x:WindowTopY>135</x:WindowTopY>
<x:protectStructure>False</x:protectStructure>
<x:protectWindows>False</x:protectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</Head>
</HTML>
 
hi,

you are using ASP, then can createobject in server and then test it.
for example, the code for creating Excel applcation
dim xl
set xl=server.createobject(&quot;Exece.application&quot;)
 
I am also working on an identical problem; although, I am not using ASP technology.
if you know of a solution, please let me know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top