Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy a sheet in an Excel workbook
Message
From
09/06/1999 14:43:48
 
 
To
09/06/1999 13:00:19
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00227990
Message ID:
00228059
Views:
41
Mark,

In this case the "after :=" is a named parameter in VB. I.E. you are executing the worksheets.copy command passing it a paramter named after. I would guess that in this case it means to insert a copy of sheet1 after sheet3.

I haven't used this command. But the fix is to find where in the parameter list passed to copy is the after parameter supposed to go. So if its the 1st parameter then the command would be:

oleapp.Worksheets("Sheet1").Copy("Sheet3")

PF


>I am trying to find the proper syntax for creating a copy of a sheet in an Excel workbook. The VBAXL8.HLP file gives examples as:
>
>Worksheets("Sheet1").Copy after := Worksheets("Sheet3")
>
>but I cannot get that to work. I have tried many variations such as:
>
>oleapp.Worksheets("Sheet1").Copy after oleapp.Worksheets("Sheet3")
>oleapp.Worksheets("Sheet1").Copy after Worksheets("Sheet3")
>oleapp.Worksheets("Sheet1").Copy('after Worksheets("Sheet3")')
>oleapp.Worksheets("Sheet1").Copy(after Worksheets("Sheet3"))
>oleapp.Worksheets("Sheet1").Copy('after oleapp.Worksheets("Sheet3")')
>oleapp.Worksheets("Sheet1").Copy 'after oleapp.Worksheets("Sheet3")'
>oleapp.Worksheets("Sheet1").Copy after 'oleapp.Worksheets("Sheet3")'
>oleapp.Worksheets("Sheet1").Copy 'after :=Worksheets("Sheet3")'
>oleapp.Worksheets("Sheet1").Copy 'after "Sheet3"'
>oleapp.Worksheets("Sheet1").Copy after "Sheet3"
>
>The best I have found is that the copy is made but placed in a new workbook. I need to be able to create the copy in the same workbook.

(On an infant's shirt): Already smarter than Bush
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform