| | | Forum Newbie
       
Group: Forum Members Last Login: 10/5/2008 7:08:15 PM Posts: 2, Visits: 10 |
| | I am working through a step by step guide to Visual Basic.NET 2002 and have reached a point where I wish to automate Excel from VB and I can't assign the type Excel.Application The line in the code is Dim xlApp As Excel.ApplicationIt tells me the type is not defined. Being an old version, the book tells me to Add Reference Microsoft Excel 10.0 Object Library, I have added Excel 12.0 Object library and I wonder if that is causing the problem. Thanks.
Give Blood. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Yesterday @ 3:25:33 AM Posts: 846, Visits: 5,126 |
| | This is vb6 forum. You need to ask in the vb net forum. I would help but I don't have Excel. Have you tried googleing for answer?
Wayne I know enough to be dangerious. It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Yesterday @ 7:34:31 PM Posts: 1,465, Visits: 3,404 |
| Welcome to A1vbcode Pocketknight.  Pocketknight (9/5/2008) I am working through a step by step guide to Visual Basic.NET 2002 As Wayne says this is the VB6 forum you need to post in Visual Basic .NET/2005/2008 As for making References to Excel in VB6 you have done the correct procedure. 
Keith http://www.martin2k.co.uk/forums/ I've been programming with VB for 12 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 10/5/2008 7:08:15 PM Posts: 2, Visits: 10 |
| Thanks to you both. I don't know how I ended up here.
Give Blood. |
| | | | Junior Member
       
Group: Forum Members Last Login: 10/14/2008 12:47:36 PM Posts: 17, Visits: 20 |
| | Even after you add the Excel reference to your project; you have to add its namespace before using it. Imports Microsoft.Office.Interop Imports Microsoft.Office.InteropModule Module1 Sub Main() Dim xlApp As Excel.Application |
| |
|
|