Creating Excel Spreadsheets in NotesIE Using OleActiveX

xiaoxiao2021-03-06  83

About Creating an Excel Spreadsheet Using

Ole Automation in notes and using

ActiveX in Internet Explorer. (We've Also Talked About Using

IE, But Not ActiveX. Here, We'll Combine The Ole and ActiveX Methods Into One Agent That Does Both, Based on The Environment.

The key to doing everything is knowing that a web agent runs on the server. So the agent's session will be on the server. When a Notes client is running an agent, the session is not on the server. So we can use this knowledge to DETERMINE What Interface To Use.

THE FIRST Thing We Want to Do Is Change Our

Openmsexcel Function Written for the Notes Client. What We'll Do Now Is Not Pass IN A File Name (We'll Always Open An Empty Sheet) And Return Either A Handle To The Spreadsheet Object In Notes OR

Nothing if we're in the browser. So we need to pass in the session to this function. Our function becomes:

Function OpenMSExcel (session As NotesSession) As Variant 'Open up a doc in Excel. If MS Excel is running, then create a new file in there. If it's' not running, then it needs to be started. Dim msExcel As Variant If session .Isonserver the 'web user print {} print {