Generating Excel Spreadsheet w/ Lotusscript using OLE - How to rearrange tabs?

Hi there,

I am using OLE methods to generate an Excel spreadsheet using Lotusscript from information in a Notes database.

I have everything working, except there is one point when I need to re-arrange a couple of the worksheets, but I can’t figure out how to do it. The Excel script code is as follows:

Sheets(“Sheet4”).Move Before:=Sheets(2)

The problem is that Lotusscript doesn’t like that. It constantly errors on the :=, saying that it isn’t expecting that.

Any ideas?

Thanks

Ben

Subject: Generating Excel Spreadsheet w/ Lotusscript using OLE - How to rearrange tabs?

the := operator fails in Notes; it’s a VBA only construct.

There is a great posting (available via the FAQ of FAQs) that describes how to convert VBA into LS and this topic is discussed.

Doug

FAQs are listed as a link when you post a new item; the FAQ of FAQs and OLE FAQ are available from there.

Subject: RE: Generating Excel Spreadsheet w/ Lotusscript using OLE - How to rearrange tabs?

And it seems to me that the Before:= and After:= was the exact code that led Brandt to write the tip in the first place.

Subject: There is nothing new under the moon and sun…

Subject: Generating Excel Spreadsheet w/ Lotusscript using OLE - How to rearrange tabs?

When you want to use LS commands to do something with your Excel-object you need to follow the LS syntax rules. So use the =-sign for assignment.

When you are not sure which commands to use, record a macro with what you want and translate the genereated VBS code into LS code.