473,320 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How read the names of excel sheets

8
hi to all,
i should read the names of the active sheets in vb6.
for example:
i've got in a excel file 3 sheets:pippo,pippo1,pippo2

my routine should count the number of the sheets and return the corrispondent sheet's name:pippo,pippo1, and pippo2.

could someone help me?

thanks to everybody
Feb 8 '07 #1
1 1303
iburyak
1,017 Expert 512MB
Check Microsoft Excel 11.0 Object Library in Project\References

[PHP]Dim objExcel As New Excel.Application
Dim i As Integer

objExcel.Workbooks.Open ("File name here")

For i = 1 To objExcel.Workbooks(1).sheets.Count
Debug.Print objExcel.Workbooks(1).sheets(i).Name
Next

objExcel.Quit
Set objExcel = Nothing[/PHP]

Good Luck
Feb 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Ilan | last post by:
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though...
1
by: Jacky11 | last post by:
Can anyone help me? Please see the code I'm using now. Public Function sheetlayout() On Error GoTo Err_Command1_Click Dim xl As Object Set xl = GetObject("c:\windows\desktop\123.csv")...
10
by: sarunnio | last post by:
How do I read an excel file to display the worksheet on the web. Can I make use of some excel automation to programmatically manipulate the excel file via the web browser. Thanks in advance. ...
1
by: Esmail Bonakarian | last post by:
Greetings all, What is the best way to access specific records in an Excel file? I have an Excel file, I want to randomly and repeatedly (maybe around up to 50 times) draw some rows of data...
0
by: bero81 | last post by:
Hi to everyboby, how can i read the names of excel sheets with vb6?i'm using from my references Microsoft excel 11.0 object library.. could someone help me,please?
1
by: aotemp | last post by:
Hi, Im having a reaaally hard time with something... Im trying to read a cell of data into a String variable. It seems like such a simple task too... Get the excel spreadsheet, get the...
3
by: Chris | last post by:
I have a python script that is driving Excel and using the win32com module. However, upon program completion there's still an Excel.exe process running in the background that I must terminate...
1
by: DennisBetten | last post by:
First of all, I need to give some credit to Mahesh Chand for providing me with an excellent basis to export data to excel. What does this code do: As the title says, this code is capable of...
2
by: shokoohkanani0 | last post by:
Hi, As my post's title indicates, I wanna read all cells of all sheets/pages in my excel file and just show the text content of each cell. I have written my code but have 2 problems: - Dim...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.