Hello Peter,
A. If you expect that your clients can create an Excel workbook according
to the Excel template in their client machine by clicking on a button in
the web page, the following two solutions may help you:
Solution 1. have a link to the template file in your web page.
When you clients click on the link, a "File download" dialog appears. If
the client click on "Open", an excel workbook will be created according to
the template, and be opened in the web browser (if the client is using
Office 2003), or in Excel (if the client is using Office 2007). If the
client click on "Save", he/she can save the template to his local directory.
The weakness of this solution: there is an unavoidable "File download"
dialog.
Solution 2. Write Office automation code in the client script, to automate
the client Office app to create and open a workbook according to the Excel
template.
Sample vbscript:
Dim app
set app = CreateObject("Excel.Application")
app.Workbooks.Open("URL TO THE .xlt FILE IN THE SHARED FOLDER")
app.Visible = True
The weakness of this solution: though this solution avoids the "File
download" dialog, it requires a setting in the client's IE:
"Initialize and script ActiveX control not marked as safe"
Otherwise, the script fails for sake of security.
B. If you expect to populate the Excel Template to a web page, you would
need to use Office automation on the server side. For instance, in asp.net
code, we automate Excel in the server to create a workbook based on the
template, save it as html, and embed the html content to our web page.
However, as Mark Rae said, Office automation in server app like ASP.NET is
NOT recommended. Microsoft does not support this scenario.
Regards,
Jialiang Ge (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.