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?