Solved

Imports Microsoft.Office.Interop.Excel

Posted on 2011-02-17
3
1,068 Views
Last Modified: 2012-05-11
I Would like to know when I add the following line :

Imports Microsoft.Office.Interop.Excel

All lines where I use drawing functions, for example::
            New Point(contenedor_arbol.Location.X - 15, 55)
            New Rectangle(0, 0, panel_plantilla1.Width - 1, panel_plantilla1.Height - 1)

Shows the following error:
                        'New' cannot be used on an interface

And When I remove:  "Imports Microsoft.Office.Interop.Excel", everything works ok

0
Comment
Question by:altariamx2003
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Den_HBR earned 500 total points
ID: 34920073
If you use "Imports Microsoft.Office.Interop.Excel"
VB assumes you are using the interface "Microsoft.Office.Interop.Excel.Point"

If you don't use "Imports Microsoft.Office.Interop.Excel"
VB assumes you are using the structure "System.Drawing.Point"


If you change you code to
 
New System.Drawing.Point(contenedor_arbol.Location.X - 15, 55)
            New System.Drawing.Rectangle(0, 0, panel_plantilla1.Width - 1, panel_plantilla1.Height - 1)

Open in new window

Your code will work
0
 

Author Comment

by:altariamx2003
ID: 34920273
ok

thanks bro
0
 

Author Comment

by:altariamx2003
ID: 34921903
hehehe

sorry I forget the points

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
A short film showing how OnPage and Connectwise integration works.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now