Microsoft Excel Objects Library 9.0 ( 'Button') 
Author Message
 Microsoft Excel Objects Library 9.0 ( 'Button')

I got this error saying Type Mismatch. This is what'd happened.

I managed to get my toolbar working fine and every button was working
perfectly. So, my next step is to generate an excel report. So I have to add
references to Microsoft Excel 9.0 Objects Library. And I started to type my
codes happily.

What happened next was that I can't compile my application as that Runtime
Error '13' kept appearing and highlighting on this line:

Set btnX = Toolbar1.Buttons.Add(, "New Staff", , tbrDefault, _
           "tbnew_user")

I tried to remove the reference to Microsoft Excel Objects and it worked
perfectly again. My guess was that Microsoft Excel has an object by the name
of 'Button' as well. I am currently using Microsoft Windows Common Controls
5.0 (SP2). So instead, I changed my declaration of btnX to:

Dim btnX as Object

instead of:

Dim btnX as Button

And it works great. Is there something wrong?



Fri, 17 Sep 2004 11:37:42 GMT  
 Microsoft Excel Objects Library 9.0 ( 'Button')
Have you added a reference to the Office object? ... that's the object that
handles menus, controlbars, etc



Quote:
> I got this error saying Type Mismatch. This is what'd happened.

> I managed to get my toolbar working fine and every button was working
> perfectly. So, my next step is to generate an excel report. So I have to
add
> references to Microsoft Excel 9.0 Objects Library. And I started to type
my
> codes happily.

> What happened next was that I can't compile my application as that Runtime
> Error '13' kept appearing and highlighting on this line:

> Set btnX = Toolbar1.Buttons.Add(, "New Staff", , tbrDefault, _
>            "tbnew_user")

> I tried to remove the reference to Microsoft Excel Objects and it worked
> perfectly again. My guess was that Microsoft Excel has an object by the
name
> of 'Button' as well. I am currently using Microsoft Windows Common
Controls
> 5.0 (SP2). So instead, I changed my declaration of btnX to:

> Dim btnX as Object

> instead of:

> Dim btnX as Button

> And it works great. Is there something wrong?



Fri, 17 Sep 2004 15:27:05 GMT  
 Microsoft Excel Objects Library 9.0 ( 'Button')
Do you mean Microsoft Office 9.0 Objects Library? I did
try to add it in and change my declaration back to:

Dim btnX as Button

Same error appear. So it's now back to:

Dim btnX as Object

and everything's back



Fri, 17 Sep 2004 16:59:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Vb and Microsoft Excel 9.0 Object Library

2. Can't find all AppointmentItem properties with Outlook 9.0 Object Library

3. Can't add a reference to Word 9.0 Object Library

4. Missing 'Microsoft SQLOLE Object Library'

5. Missing 'Microsoft SQLOLE Object Library'

6. Using the Range object in Excel Object Library 9.0

7. Reference to Microsoft Excel 9.0 Library

8. MISSING: Microsoft Outlook 9.0 Object Library

9. Microsoft Word 9.0 Object Library

10. Using Microsoft Word 9.0 Object Library Reference

11. Microsoft's OLE DB Simple Provider 1.5 Library isn't cutting it :(

12. Microsoft VBScript runtime (0x800A01A8) - Object required: ''

 

 
Powered by phpBB® Forum Software