Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: .net and excel???

    I get this error :
    an unhandled exception of type 'system.runtime.interopservices.comexception' occurred in mscorlib.dll

    Addtl info : Select method of range Class failed

    When trying to excecute the most simple code:
    Dim inv As Excel.Worksheet
    Dim all As Excel.Range
    inv = xl.Worksheets("Invoice")
    'inv.Range("a1").Select()
    all = inv.UsedRange
    all.Select


    WHAT IS UP WITH THIS DOG?

    ~M

  2. #2
    Join Date
    Dec 2003
    Location
    Östersund Sweden
    Posts
    60
    Mike,

    Something along this one should at least give You an relevant error-message (at least something to start with):

    Try
    'Here You write the TryStatement
    'Catch expression' As Exception
    Console.WriteLine(" Error:" & f.Message)
    Exit Sub
    End Try

    Does the error occur when You use VSTools or is it via the standard COM-connection?

    Which version of XL are You working with?
    Which version of office.dll in Net ?

    Have faith although You working with Net
    Dennis
    Kind regards,
    Dennis

Posting Permissions

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