Verb in Excel

I have an Excel spreadsheet with another Excel spreadsheet embedded within it.

I want to modify the contents of a cell in the embedded spreadsheet. The recorded macro in Excel that will do this sucessfully in Excel is as follows…

Sub Macro1()

ActiveSheet.Shapes("Object 2").Select

Selection.Verb Verb:=1

Range("A4").Select

ActiveCell.FormulaR1C1 = "hello world"

ActiveWindow.Close

End Sub

I can convert this to LotusScript… except for the Selection.Verb line…

Does anybody know to convert that line to work in LotusScript?

Subject: Object 2??

Charlie - Is there a reason you need to select the object “Object2”? If you’re just updating the value of a cell, you should be able to delete the row that selects it and the one with the “.verb” command.

All you should need is:

Range(“A4”).Formula = “hello world”

ActiveWindow.Close

Regards

Subject: Embedded Worksheet

I’m not updating a cell in the Active Worksheet… I’m updating a cell in an Embedded Worksheet within the Active Worksheet… hence I needed to “Select”…

Subject: LS does not support named arguments

The offending part is “Verb:=1” in the line “Selection.Verb Verb:=1” of your script.

LotusSript does not support named arguments (at least not to my knowledge). Try replacing that line by something that lets you avoid using a named argument.

Subject: I found something that works

I found that the following will work…

xl.Selection.Verb 1

(and xl is a variant for the Excel application object)