ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bad declartion of Excel in VB program (https://www.excelbanter.com/excel-programming/289159-bad-declartion-excel-vbulletin-program.html)

mike

Bad declartion of Excel in VB program
 
I'm trying to instantiate a excel application from VB and
have found several examples of programs in MS help
articles how to do this. However the statement "xlApp1 As
Excel.Application" causes the runtime error "User-defined
type not defined" What am I missing? --- Mike

Tom Ogilvy

Bad declartion of Excel in VB program
 
To use that construct, you need to create a reference to the Excel Object
library - otherwise, VB doesn't know what Excel.Application is.

--
Regards,
Tom Ogilvy

Mike wrote in message
...
I'm trying to instantiate a excel application from VB and
have found several examples of programs in MS help
articles how to do this. However the statement "xlApp1 As
Excel.Application" causes the runtime error "User-defined
type not defined" What am I missing? --- Mike




mike

Bad declartion of Excel in VB program
 
hay Tom. Yep that was it. This now allows me to have an
early binding object. I've been poking at it to try to get
the chart to show the graph of the data but unlike the
late binding method:
xlChart1.SetSourceData Source:=xlSheet1.Range("A1").Resize
(100, 2)

I can't seem to find the method? Any help would be much
appreciated. --- Mike

-----Original Message-----
To use that construct, you need to create a reference to

the Excel Object
library - otherwise, VB doesn't know what

Excel.Application is.

--
Regards,
Tom Ogilvy

Mike wrote in

message
...
I'm trying to instantiate a excel application from VB

and
have found several examples of programs in MS help
articles how to do this. However the statement "xlApp1

As
Excel.Application" causes the runtime error "User-

defined
type not defined" What am I missing? --- Mike



.



All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com