472,122 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

How to declare a variable as an excel worksheet in vba

48
i am using access 2007 and i am trying to read data directly from a spreadsheet. i am running into this error User defined object not defined. i am declaring the variable as follow
dim Mywb as workbook
dim Myws as worksheet
Dec 20 '11 #1

✓ answered by Rabbit

Assuming you've included the reference to the Excel library, you need to qualify it using Excel.. Meaning you need to use Excel.Workbook

2 1712
Rabbit
12,516 Expert Mod 8TB
Assuming you've included the reference to the Excel library, you need to qualify it using Excel.. Meaning you need to use Excel.Workbook
Dec 20 '11 #2
almaroc
48
Thanks Rabbit that took care of it. i really appreciate it.
Dec 21 '11 #3

Post your reply

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

Similar topics

2 posts views Thread by Steve Kershaw | last post: by
reply views Thread by leo001 | last post: by

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.