Hi,

I have the following VBA code which I want to convert to javascript.
this is to create a textbox shape in an excel sheet and put some text in it, and format part of the text.

vba Code
Sub test()

Dim wbk1 As Excel.Workbook
Dim sht1 As Excel.Worksheet
Set wbk1 = Workbooks.Add
Dim m As Shape

Set sht1 = wbk1.Worksheets(1)

MsgBox sht1.Name

Set m = sht1.Shapes.AddTextbox(1, 0, 0, 100, 100)

m.TextFrame.Characters.Text = "First Line" & Chr(10) & "Second Line"
m.TextFrame.Characters(4, 4).Font.Bold = 1

End Sub


I have the following Javascript code for creating the excel workbook and put the shape in it. I cant do the rest of the code.
Please help


JavaScript code:
var xls = new ActiveXObject ( "Excel.Application" );
var newBook = xls.Workbooks.Add;
newBook.Worksheets.Add;
newBook.Worksheets(1).Activate;

ws1 = newBook.Worksheets(1);
shp1 = ws1.Shapes.Addtextbox(1,0,0,100,100);
sh1.TextFrame.Characters.Text = "First Line" +"\n"+ "Second Line";


The last line in the above code is not working.(it says: object does not support this property")

please help

Thanks in advance.