Craig Moran wrote:

> I have been trying to implement this Excel subroutine in Ruby,

So where's your Ruby code? That will help us help you.

> but am having trouble with the Move command.

I am having trouble finding out what trouble you are having.

> The real issue is with the 
> "after:=Sheets()" portion of the command in the code below.

What is the real issue, specifically?

> Does anyone know how to get around this using Ruby and win32ole?

Get around what, please?

> This is what the code looks like in Excel VBA.  All it does is sort the
> sheets of an Excel workbook by name.
> Thanks!

You're most welcome.

> Craig
> 
> Sub Sheet_Sort()
> 
> Dim shtCount As Integer
> shtCount = Sheets.Count
> 
> For x = 3 To shtCount - 1
>   For i = 3 To shtCount - 1
>     If Worksheets(i).Name > Worksheets(i + 1).Name Then
>       Worksheets(i).Move after:=Sheets(i + 1)
>     End If
>   Next i
> Next x
> 
> End Sub

Ruby code? By the way, the listed sort routine is an exceptionally
inefficient bubble sort. I strongly recommend that you read all the sheet
names into Ruby, sort them in Ruby, and write them out again. This would
most likely be faster than using the example above as a prototype,
especially as the number of data items increases.

-- 
Paul Lutus
http://www.arachnoid.com