I’m connecting to Excel with ADO, but it only works if I specify the sheet names. I won’t know those at runtime. Is there any method to get the sheet names? Excel automation?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Once you’ve open the ADO connection, you need call the OpenSchema() method which returns a results set with the sheet names as "table_name"
I’m a bit rusty with VBA but that should look something like that