use namespace in VB.NET

M

Maileen

Hi,

I would like to know how can we use a namespace in VB.NET ?
i tried :
Imports xlApp = Microsoft.Office.Interop.Excel
and
Dim test As New Microsoft.Office.Interop.Excel

but without success.
First i install PIA for Office XP and include the COM as usual.
Is there something else to do first ?

thanks a lot,
Maileen
 
J

Jay B. Harlow [MVP - Outlook]

Maileen,
First i install PIA for Office XP and include the COM as usual.
Is there something else to do first ?
What do you mean "include the COM as usual"?

You need to install the PIA first as you did. Then you use "Project - Add
Reference - COM" and select Microsoft Excel, VS.NET will see that there is a
PIA available and use the PIA.

After you add the reference you should be able to import the namespace. You
may want to use Object Browser, after you Add Reference, to ensure that you
are using the correct namespace, as I seem to remember that the namespaces
differ when you are using a PIA or not.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top