Solved

Imports Microsoft.Office.Interop.Excel

Posted on 2011-02-17
3
1,090 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

726 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