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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spreadsheets and worksheets. 2

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
I am using VB6 drag and drop to get a spreadsheet's location. How can I obtain the name and number of sheets within a spreadsheet ??

Solo7 [thumbsup2]
 
Dim xlboject as object
DIm lngNumberOfSheets as long
Dim i as long
Dim strNameOfSheet as string

Set xlobject = CreateObject("Excel.Application")
xlobject.Worksheets.Count 'number of sheets in a spreadsheet

For i = 1 to lngNumberOfSheets
strNameOfSheet = xlobject.Worksheets(i).Name 'name of sheet
............
Next i

John Borges
 
jbpez,
In my eager anticipation of a problem solved I forgot to ask at what point do I specify the spreadsheet I am querying ??

solo7 [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top