Results 1 to 8 of 8

Thread: bug in .net?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    bug in .net?

    Can someone do a quick test as there seems to be a bug I think?
    open a new project using vb.net, now you have form1. Add the reference to excel 9.0
    in a button click event you can type dim oexcel as new excel.application
    this works fine.
    Now delete form1 and add a new form. This time do the same as above. i.e. in the click event place the same code.
    Do you get an error? if so why?
    Thanks

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    What is the error you are getting??

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    e

    The error is excel.application is not defined
    As if there is noreference to the excel library. But there is.

    This is very strange and I can not figure it out why it is happening.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    What VS.NET version you are talking about ?

  5. #5
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    This is not a bug. Whenever you add a new reference to your project, you have to place a using or imports statement at the top of the form you want to use that reference in. So if you added a reference to the using Microsoft.Office.Core object, at the top of the form, you would put imports using Microsoft.Office.Core or you can just use the fully qualified name.
    Last edited by DevGrp; Jul 12th, 2003 at 11:55 AM.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678
    currently there is a reference to excel but there is no imports microsoft.office.core on the top. And it still works
    ??

  7. #7
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    I did'nt mean 'that' reference. That was just an example.

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by fmardani
    currently there is a reference to excel but there is no imports microsoft.office.core on the top. And it still works
    ??
    Yes , it can still work . Imports and using (in C#) is not important . It's only a way to shorten function call or sub .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width