How to automate Excel from an HTML Web page by using JScript

SUMMARY

This article demonstrates how to create and manipulate a Microsoft Office Excel workbook from an HTML page.

MORE INFORMATION

This article illustrates JScript code that automates Excel. JScript has no internal means of creating SAFEARRAYs. When using automation, if you call a function that requires a SAFEARRAY, you can use VBScript to create the SAFEARRAY. The code below demonstrates this combination of JScript and VBScript code.

Save the file to a directory of your choice with the file name Excelaut.htm.

Close Notepad and start Internet Explorer.

In the Address bar, type C:\path\excelaut.htm, where path is the directory you saved the file in.

When Internet Explorer loads the file, you'll see one sentence with a button. When you press the button, Excel will start on the client's machine and fill with data.

REFERENCES

This article parallels other articles that describe the same process using different languages. For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base: