meep_meep
asked on
Excel: Sheets.Add After:=Sheets(Sheets.Count)
Trying to dupplicate a WorkSheet by "Adding after" a worksheet tab within Excel. The only way I succeeded was this way:
tmpSheet=GETOBJECT('','Exc el.Sheet')
XLApp = tmpSheet.Application
XLapp.DisplayAlerts=.t.
XLApp.Visible=.t.
oTimeSheets = XLApp.Workbooks.Open("c:\E xcel\Empty TimeSheet. XLS")
XLSheet = oTimeSheets.ActiveSheet
XLSheet.Cells.Select
XLSheet.Cells.Copy
XLApp.Sheets.Add()
XLNewSheet = XLApp.ActiveSheet
XLNewSheet.Cells.Select
XLNewSheet.Paste
XLApp.ActiveWindow.Zoom = 55
But this create a new Worksheet "Before" the origin tab. ADD should be as follow:
Add(Before as Variant, After as Variant, Count as Variant, Type as Variant) as Object.
Anybody can help me "translating" this into Foxpro code ? I would need to add after 1 worksheet, name "NewTimeSheet".
Thanks
tmpSheet=GETOBJECT('','Exc
XLApp = tmpSheet.Application
XLapp.DisplayAlerts=.t.
XLApp.Visible=.t.
oTimeSheets = XLApp.Workbooks.Open("c:\E
XLSheet = oTimeSheets.ActiveSheet
XLSheet.Cells.Select
XLSheet.Cells.Copy
XLApp.Sheets.Add()
XLNewSheet = XLApp.ActiveSheet
XLNewSheet.Cells.Select
XLNewSheet.Paste
XLApp.ActiveWindow.Zoom = 55
But this create a new Worksheet "Before" the origin tab. ADD should be as follow:
Add(Before as Variant, After as Variant, Count as Variant, Type as Variant) as Object.
Anybody can help me "translating" this into Foxpro code ? I would need to add after 1 worksheet, name "NewTimeSheet".
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER