OLE Commands to Duplicate a Sheet

  • Thread starter Thread starter pierrerama
  • Start date Start date
P

pierrerama

Hi, I would like to know how duplicate a Sheet in excel.

I know only how create a new sheet : xExcel>>Sheets>>Add()

I tried to copy the sheet, create a new sheet, and paste, but it
doesn't work, because Excel display a prompt.
Excel ask if I want to save my copy in clipboard , because the copy is
too important.


Could anyone help me with the correct OLE commands to duplicate a
sheet? An
example program would be great if anyone has one.

Many thanks,

Pierre
 
ActiveSheet.Copy After:=ActiveSheet

Change both "ActiveSheet"s to whatever you need.

HTH, CoRrRan

(e-mail address removed) wrote in @s48g2000cws.googlegroups.com:
 
Thanks to answer me.

But, this command do not work in my software. I use an externel
software ( WINDEV) which use OLE to control EXCEL.

Do you know another command to do the same things?

A command without space?

All command OLE in my software contains no space, and are like this:

MySheetXLS>>Range("A1:"+AEZ+"1")>>Select()

MySheetXLS>>Selection>>Copy()

MySheetXLS>>Range("AE52")>>Select()

MySheetXLS>>ActiveSheet>>Paste()

Pierre
 
It's probably an issue with Windev. This is different than the OLE I am
familiar with, which is basically how one VBA program accesses objects in
another. However, you should try variations on the syntax CoRrRaN provided:

MySheetXLS>>Copy(MySheetXLS)

Check the Excel object model to see what the arguments for Copy are for a
worksheet, and use the appropriate syntax for Windev. For example, how do
you have to deal with optional arguments or named arguments?

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top