Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy a sheet in an Excel workbook
Message
From
09/06/1999 16:07:15
 
 
To
09/06/1999 14:43:48
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00227990
Message ID:
00228123
Views:
44
Having absolutely no experience with VB I don't have much of a clue as to how to get past this. Is there anyone that knows where I can find information on the parameters and how to use them in VFP?

I've been able to do a lot of other things with Excel, but having spend hours trying to figure this out, there must be an easy anwser out there somewhere.

Mark


>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.
Mark Johns
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform