Solved

Imports Microsoft.Office.Interop.Excel

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studios 1 89
Passing data between Forms 3 28
vb.net datagrid scroll automatically to the first found row 11 28
Convert VB web project to C# 3 40
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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