Introduction
  Welcome
  The Web Reporting Solution
  What is ExcelWriter?
  Features and Benefits
  New in This Version  V4
  Requirements
  Edition Differences
  Frequently Asked Questions
  Troubleshooting

Quick Start
  Creating Your First Spreadsheet
  Adding a Formula
  Adding Formatting
  Importing from a Database

Features In Depth
  Addressing Cells
  Setting Values
  Output Options
  Adding Charts
  Reading an Existing Spreadsheet
  Modifying an Existing Spreadsheet
  The Range Object
  Template Spreadsheets
  How to Use Templates
  ExcelApp.Open vs. ExcelTemplate
  Using ExcelTemplate with PivotTables
  Templates and Charts
  Reliable Spreadsheet Download  V4
  Page Setup
  Formatting Headers & Footers
  Protecting your Worksheet
  Multilingual Support  V4
  XML Import

HotCell Technology  V4
  What is HotCell Technology?
  Upload Example
  Advanced POST Example
  Advanced Upload Example

Programmer's Reference
  Object Model
      ExcelTemplate Object
      ExcelApplication Object
         3DProperties Object
         Area Object
         Axis Object
         Cells Object
         Cell Object
         Charts Object
         Chart Object
         ChartFrame Object
         Font Object
         Line Object
         PageSetup Object
         Pictures Object
         Picture Object
         Range Object
         SeriesCollection Object
         Series Object
         Style Object
         Worksheets Object
         Worksheet Object
  Formula Functions
  Formula Calculation Operators
  Formatting Codes
  Chart Codes

Installation
  Quick Installation
  Configuring IIS
  Security Considerations

External Links
  ExcelWriter Home Page
  Technical Support
  ExcelWriter Demos
  SoftArtisans Home Page
  E-mail General Questions
  E-mail Technical Support
  Legal Information

HotCell Technology
Upload Example

New in V4

*This feature is not available in
ExcelWriterSE, ExcelWriterLE,
and ExcelWriterFree.

Editing Cells with Known Positions

The following sample performs the exact same functions as the POST Example, except it goes about it in a very different manner. Instead of just submitting the changed cell information to the server, the entire workbook is uploaded and the values are read from it by ExcelWriter on the server-side.

Run the Sample
Description See the Code
form.asp Entry point to the sample [View Source]
GetEmployeeDataSheet.asp ExcelTemplate workbook generator [View Source]
UplUpdate.aspDatabase update handler [View Source]
Template.xls Template Excel workbook
Note: Go to Tools > Macros > Visual Basic Editor to see the VBA code
[View Template]

The sample works as follows:

  1. Form.asp loads and you can select an Employee ID for the individual whose information you would like to edit. To allow a file upload from the client, an external object called SoftArtisans.XLWAssistant is required to be installed on the client machine. This object is included with ExcelWriter in XLWAssis.cab so that your users can install XLWAssistant on-demand when they first visit form.asp, or any page you choose. This object must be installed in order for the VBA code in template.xls to function properly.

    To create a client-side instance of XLWAssistant, use the <object> tag with XLWAssistant's unique class id:
    	<OBJECT classid="clsid:381A579F-C095-433d-8AEF-96CED6EC227F"
    	codebase="XLWAssis.cab" id="XLWAssistant"></OBJECT>
    The codebase attribute specifies XLWAssistant's location. When you upgrade XLWAssistant, add the new version number to the codebase value. This will allow an automatic update of the client version. To find the version number:

    1. Extract XLWAssis.dll from XLWAssis.cab
    2. Right-click XLWAssis.dll
    3. Open Properties
    4. Select the Version tab

    For example, if the version number is 1.1.1.1. Add "version=1,1,1,1" to the codebase attribute:
    	<OBJECT classid="clsid:381A579F-C095-433d-8AEF-96CED6EC227F"
    	codebase="XLWAssis.cab#version=1,1,1,1" id="XLWAssistant"></OBJECT>
    * SoftArtisans.XLWAssistant is not available in ExcelWriterLE.

  2. Form.asp submits data to GetEmployeeDataSheet.asp, which uses ExcelWriter's ExcelTemplate object to populate the form with the chosen employee's information.

  3. In Excel, you can edit the employee's information. In template.xls, the VBA code in the btnUpdate_OnClick subroutine saves the workbook to the client's disk, and uploads the file to UplUpdate.asp. The VBA code in this version of template.xls uses the XLWAssistant object to perform the file upload.

  4. In UplUpdate.asp, SoftArtisans FileUp receives the file and saves it to the server's disk:
    Set oFileUp = Server.CreateObject("SoftArtisans.FileUp")
    oFileUp.Form("FILE").SaveAs Server.MapPath("./upload.xls")

    SoftArtisans FileUp is a server-side file-transfer component. Note that SoftArtisans FileUp is not included with ExcelWriter.

    ExcelWriter opens the file, reads the values from the cells, forms a SQL UPDATE statement, and executes the query, updating the data source.

Top


Copyright © 2003, SoftArtisans, Inc.