Creating an Excel spreadsheet within VB

I am trying to put a shape into a spreadsheet.  I have no problems creating the spreadsheet, but I am trying to add an auto shape using the command:
   ".Shapes.AddShape(msoShapeOval, 341.4, 146.4, 121.2, 116.4)".
VB doesn't like the "msoShapeOval"  keyword.  Does anyone have the definitions of the msoAutoShapeTypes?
TopCatOnyxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Erick37Commented:
Private Const msoShapeOval = 9
0
TopCatOnyxAuthor Commented:
Thanks, is there a list of all the constants for the msoShapeTypes somewhere?
0
RogueSolutionsCommented:

Add a reference to Microsoft Office 9.0 (or 10.0, whatever you have) and you should find the constants become available to you.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Erick37Commented:
Add a reference to "Microsoft Office 10 Object Library"

Then bring up the Object Browser by pressing F2 and search for msoAutoShapeType

Or in your code you can type:

Office.MsoAutoShapeType.msoShapeOval
0
TopCatOnyxAuthor Commented:
Thanks, I added a referance to Microsoft Office, and it broke my referance for ADODB (I'm using SQL also).  Now I can't restore the ADODB referance   Now I get "User defined type not defined" for "Global dbData as ADODB.Connection".  Removing the referance to MS Office didn't fix the problem.  This was working fine before adding the referance to MS Office 9.0 Object Library.  Any thoughts?
0
Erick37Commented:
>>Now I can't restore the ADODB referance<<

What's the error?
0
RogueSolutionsCommented:

So, you've taken the Reference to MS Office off again (i.e. unchecked it) and made sure you aren't using any mso constants (for now).  

Is the Microsoft Active Data Objects reference still checked?  (it may be version 2.1, 2.5, etc. depends on your machine).  If not you'll need to re-check it.

Personally, I'd then save my project and close off VB and restart to make sure it wasn't messing around.  No need to reboot or anything that drastic.

Hopefully that should help.  The MS Office reference shoudln't have had that effect, are you sure nothing else changed?
0
Erick37Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TopCatOnyxAuthor Commented:
The error is: "User defined type not defined" for "Global dbData as ADODB.Connection".  I don't see a referance for "Microsoft Active Data Objects", however, I do have Microsoft  DAO 3.6 Object Library checked, as well as Micorsoft Data Binding Collection.  I have unchecked the MS Office referance, saved, closed and reopened the  project, and I still get the error.
0
RogueSolutionsCommented:

DAO is the older database connection stuff.  You may have both types of connectivity going on within your application but usually you wouldn't need DAO if you are working with ADO.  Leave it in for now.

You will need a reference to the Microsoft ActiveX Data Objects (either 2.1, or 2.5).  If you don't have either of these then let us know what you do have under Microsoft ActiveX Data Objects.

If you have any other apps you have written, open them and go see what ADO reference they have.

Has this app ever run before?  Maybe the reference has never been right but you couldn't tell as you had the Office oval error.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.