Group: microsoft.public.word.vba.general
From: Jay Freedman
Date: Friday, February 22, 2008 6:26 PM
Subject: Re: Creating Excel Spreadsheet in Word with VBA

On Fri, 22 Feb 2008 12:32:17 -0800 (PST), melon wrote:

>On Feb 22, 3:27 pm, melon wrote:
>> I got an error with this (type mismatch)
>>
>> objWord.ActiveDocument.Bookmarks("Required").Range.InlineShapes.AddOLEControl
>> ClassType:="Excel.Sheet"
>>
>> What cause that?
>
>I don't think the syntax is incorrect, since if I change the ClassType
>to something like "Forms.ComboBox.1" then it works.

I don't know why that doesn't work -- the documentation says it should be OK --
but I get the same error.

Instead of the AddOLEControl method, use the AddOLEObject method (which is what
I showed in my first response). I found that does work.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.

Safety Articles | Usenet Groups | Usenet News | Bluegrass