Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting a Specific Excel Worksheet from VFP

Status
Not open for further replies.

FoxNovice

Programmer
Apr 10, 2008
25
0
0
US
We want to use VFP 6.0 to access and update specific cells from specific worksheets (tabs) in an existing Excel 2003 workbook.

The Forums have shown me the basic way to open the Excel workbook, update a cell, and save, but I cannot figure out how to get VFP to select a specific worksheet (it updates the worksheet that is currently displayed when the workbook is opened).

For example, if I have 12 worksheets (Jan., Feb., Mar., etc.) and the Excel workbook was last saved in Excel on the Mar. worksheet, how do I get VFP to access and update the Apr. or May. worksheet??

Thanks!
 

See if this helps: thread1251-1124785 has somewhat similar requirements.
 
For example, if I have 12 worksheets (Jan., Feb., Mar., etc.) and the Excel workbook was last saved in Excel on the Mar. worksheet, how do I get VFP to access and update the Apr. or May. worksheet??

If you have named your worksheets, you can reference them by name. You can also reference them by index.

oXl.ActiveWorkBook.WorkSheets( "Mar" ).Activate()

or

oXl.ActiveWorkBook.WorkSheets( 3 ).Activate()


Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top