Excel Automation - Copy Sheets After,Before

Hi All

I came across this discussion thread in 4/5 forum about inability to use After := and Before := while trying to copy excel sheets from one work book to another.

http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/665542dacb7d886f85256b210060407a?OpenDocument

The LS code cannot be saved with Before : and after : in the statements.

I managed to find a workaround after some trial and error

We can use the following syntax

  1. to copy before use

xlSheet1.Copy xlWorkbook2.Sheets(1)

  1. to Copy after certain sheet use

xlSheet2.Copy Null,xlWorkbook2.Sheets(i)

And the great thing is it works !!!

Regards

Siddharth