PxPlus User Forum
Main Board => Discussions => Programming => Topic started by: JuanVelazquez on October 28, 2019, 08:51:50 AM
-
Good morning
I have an excel book which is composed of several sheets. Currently I have the need to copy or duplicate one of the sheets within the same book but I have not got the form.
The syntax used in VB is:
Worksheets ("Source"). Copy After: = Worksheets ("Final")
Where "Origin" is the sheet to be copied and will be located after the "Final" sheet.
So far I have not been able to properly use the Copy property.
I currently use the object:
DEF OBJECT ex, "excel.application"
Thank you very much for the help you can give me.
Regards
-
->def object excel,"Excel.Application"
->workbook=excel'workbooks'open("filename.xlsx")
->workbook'worksheets("Origin")'copy(*,*workbook'worksheets("Final"))
->excel'visible=1
By default you'll end up with a new worksheet named "Origin (2)".
-
->def object excel,"Excel.Application"
->workbook=excel'workbooks'open("filename.xlsx")
->workbook'worksheets("Origin")'copy(*,*workbook'worksheets("Final"))
->excel'visible=1
By default you'll end up with a new worksheet named "Origin (2)".
Hi Koenv
Thanks for the help, it worked perfectly
Regards