Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Gerraint Pritchard
  Where is Gerraint Pritchard?
 Wrexham
 United Kingdom
 Gerraint Pritchard
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: Excel Automation
Thread ID: 310688 Message ID: 310699 # Views: 31 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Microsoft Office Automation
Date: Thursday, June 23, 2011 3:48:06 PM         
   


Thanks

works a treat




> > Hi Experts
> >
> > I use an Excel workbook as a template and have the follwoing code:
> >
> > tmpsheet = Getobject('','excel.sheet')
> > XLApp = tmpsheet.Application
> > XLApp.Visible = .F.
> > XLApp.WorkBooks.Add()
> > XLApp.Application.Workbooks.Open(xpath+"\event builder\D2B-workbook-V26-master.xlt")
> > XLApp.ActiveSheet
> > XLSheet = XLApp.ActiveSheet
> > loActiveSheet = XLSheet
> >
> > This works fine but how would I change the active sheet to sheet2
> >
> > Thanks in advance
> >
> > Gerraint
>
>
> XLApp.Sheets(2).Select 
> 

>
> -----------------
> Borislav Borissov
>
> Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
> The only thing normal about database guys is their tables.

ENTIRE THREAD

Excel Automation Posted by Gerraint Pritchard @ 6/23/2011 1:45:18 PM
RE: Excel Automation Posted by Borislav Borissov @ 6/23/2011 2:04:35 PM
RE: Excel Automation Posted by Gerraint Pritchard @ 6/23/2011 3:48:06 PM