Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling .Move() From Javascript
Hi! I am building a spreadsheet using Javascript and need to reorder
some of the sheets. The example mentioned in the Excel Help file shows exactly what I want to do: Move Method Example This example moves Sheet1 after Sheet3 in the active workbook. Worksheets("Sheet1").Move after:=Worksheets("Sheet3") Can someone tell me how to translate this into Javascript? Many thanks! Sharon |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling .Move() From Javascript
Hi Sharon, Please let us have the code how you handle Excel via JavaScript? Using wshshell? execScript? or location.href='Book1.xls'; ? --- ~~ Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling .Move() From Javascript
Or why not use VbScript??
Here is a sample that I wrote for you. Calling VbScript from JavaScript. <html <head <script language="JavaScript"<!-- function excel() { execScript("ControlExcel",'VBScript'); } // --</script <script language="VBScript"<!-- Sub ControlExcel() Dim XL, WB, i Set XL = CreateObject("Excel.Application") XL.Visible =True Set WB = XL.Workbooks.Add For i = 1 to 3 XL.Worksheets.Add Next Msgbox WB.Sheets(WB.Sheets.Count).name WB.Sheets(1).Select WB.Sheets(1).Move ,WB.Sheets(WB.Sheets.Count) End Sub --</script <a href="javascript:excel()"Open text.xls via Excel</a </head </html -- Kind Regards Colo /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Colo of 'The Road of The Cell Masters' :) URL:http://www.interq.or.jp/sun/puremis/...astersLink.htm /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ "SharonGordon" wrote in message m... Hi! I am building a spreadsheet using Javascript and need to reorder some of the sheets. The example mentioned in the Excel Help file shows exactly what I want to do: Move Method Example This example moves Sheet1 after Sheet3 in the active workbook. Worksheets("Sheet1").Move after:=Worksheets("Sheet3") Can someone tell me how to translate this into Javascript? Many thanks! Sharon |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling .Move() From Javascript
Sorry please use this code.
<html <head <script language="JavaScript"<!-- function excel() { execScript("ControlExcel",'VBScript'); } // --</script <script language="VBScript"<!-- Sub ControlExcel() Dim XL, WB, i Set XL = CreateObject("Excel.Application") XL.Visible =True Set WB = XL.Workbooks.Add For i = 1 to 3 XL.Worksheets.Add Next MSGBOX "Move worksheet(1) to the end" WB.Sheets(1).Move ,WB.Sheets(WB.Sheets.Count) End Sub --</script <a href="javascript:excel()"Create an Excel Instance and handle via VBScript</a </head </html -- Kind Regards Colo /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Colo of 'The Road of The Cell Masters' :) URL:http://www.interq.or.jp/sun/puremis/...astersLink.htm /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ "SharonGordon" wrote in message m... Hi! I am building a spreadsheet using Javascript and need to reorder some of the sheets. The example mentioned in the Excel Help file shows exactly what I want to do: Move Method Example This example moves Sheet1 after Sheet3 in the active workbook. Worksheets("Sheet1").Move after:=Worksheets("Sheet3") Can someone tell me how to translate this into Javascript? Many thanks! Sharon |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling .Move() From Javascript
Colo,
Hi! I am actually embedding Javascript in some ColdFusion code. And, I was able to get the following to work finally: oWB.Sheets("Sheet1").Move(null,oWB.Sheets(oWB.Shee ts.Count)); Many thanks for your help! Sharon |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Calling VBA code from html or javascript | Excel Discussion (Misc queries) | |||
link javascript | Excel Worksheet Functions | |||
link javascript | Excel Worksheet Functions | |||
Javascript Question | New Users to Excel | |||
VBA formulas in javascript | Excel Programming |