Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling VBA code from html or javascript Brent E Excel Discussion (Misc queries) 0 October 16th 08 11:27 PM
link javascript sureshkasi1985 via OfficeKB.com Excel Worksheet Functions 0 June 5th 08 11:47 AM
link javascript sureshkasi1985 via OfficeKB.com Excel Worksheet Functions 0 June 5th 08 11:44 AM
Javascript Question jmkratt New Users to Excel 1 August 22nd 06 09:02 AM
VBA formulas in javascript smr78 Excel Programming 1 October 6th 03 04:19 PM


All times are GMT +1. The time now is 11:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"