Hi everyone,
I have a dynamic list page in ASP which works pretty good. I added a link that will export the data on that dynamic page into MS Excel - that works pretty well too. Now, I'm trying to add the title to the Excel file and tab name (default is Sheet1).
This is what I have thus far, but with an error message:
------------------------------------------------------------
<!-- Begin Excel Export -->
<%
' *** Download Excel File Format.
Download = request.querystring ("download")
If Download = "excel" Then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Yourfilename.xls"
<html xmlns=" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:x="urn:schemas-microsoft-comffice:excel">
<head>
<title>Title</title>
<!--[if gte mso 9]><xml>
<oocumentProperties>
<o:Subject>Subject</o:Subject>
<o:Author>Author</o:Author>
<o:Keywords>Keyword1, Keyword 2</o:Keywords>
<oescription>Comment Line 1 Comment Line 2</oescription>
<o:Category>Category</o:Category>
<o:Manager>Manager Name</o:Manager>
<o:Company>Company Name</o:Company>
</oocumentProperties>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Worksheet Name</x:Name>
<x:WorksheetOptions>
<xrotectContents>False</xrotectContents>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
<style>
<!--
br {mso-data-placement:same-cell;}
-->
</style>
Else
<head>
<title>Intec Administration - Event Registrations Listings</title>
'The rest of your header info...
------------------------------------------------------------
But I'm getting an error message in the browser saying:
------------------------------------------------------------
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/inteclink/admin/events/eventReg.asp, line 261
<html xmlns=" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:x="urn:schemas-microsoft-comffice:excel">
------------------------------------------------------------
Any help will be greatly appreciate it.
Thanks in advance,
Dan
I have a dynamic list page in ASP which works pretty good. I added a link that will export the data on that dynamic page into MS Excel - that works pretty well too. Now, I'm trying to add the title to the Excel file and tab name (default is Sheet1).
This is what I have thus far, but with an error message:
------------------------------------------------------------
<!-- Begin Excel Export -->
<%
' *** Download Excel File Format.
Download = request.querystring ("download")
If Download = "excel" Then
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Yourfilename.xls"
<html xmlns=" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:x="urn:schemas-microsoft-comffice:excel">
<head>
<title>Title</title>
<!--[if gte mso 9]><xml>
<oocumentProperties>
<o:Subject>Subject</o:Subject>
<o:Author>Author</o:Author>
<o:Keywords>Keyword1, Keyword 2</o:Keywords>
<oescription>Comment Line 1 Comment Line 2</oescription>
<o:Category>Category</o:Category>
<o:Manager>Manager Name</o:Manager>
<o:Company>Company Name</o:Company>
</oocumentProperties>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Worksheet Name</x:Name>
<x:WorksheetOptions>
<xrotectContents>False</xrotectContents>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
<style>
<!--
br {mso-data-placement:same-cell;}
-->
</style>
Else
<head>
<title>Intec Administration - Event Registrations Listings</title>
'The rest of your header info...
------------------------------------------------------------
But I'm getting an error message in the browser saying:
------------------------------------------------------------
Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/inteclink/admin/events/eventReg.asp, line 261
<html xmlns=" xmlns="urn:schemas-microsoft-comfficeffice" xmlns:x="urn:schemas-microsoft-comffice:excel">
------------------------------------------------------------
Any help will be greatly appreciate it.
Thanks in advance,
Dan