Solved

Imports Microsoft.Office.Interop.Excel

Posted on 2011-02-17
3
1,076 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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