Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Create Excel in VB.NET

Create Excel in VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestionworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thanh_bkhn
    wrote on last edited by
    #1

    I have to programing with VB.NET and Excel. I use Microsoft Development Environment 2003 and Excel 2000. But I cannot create a workbook: Dim xlsApp As Excel.Application Dim xlsWB As Excel.Workbook xlsApp = New Excel.Application xlsWB = xlsApp.Workbooks.Add() <-- error in this line The error message is: "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred " and "Additional information: Old format or invalid type library." I added the Microsoft Excel 9.0 Object Library (excel9.olb) as a reference and use Imports Excel. Anyone give me a suggestion? Thank you

    D 1 Reply Last reply
    0
    • T thanh_bkhn

      I have to programing with VB.NET and Excel. I use Microsoft Development Environment 2003 and Excel 2000. But I cannot create a workbook: Dim xlsApp As Excel.Application Dim xlsWB As Excel.Workbook xlsApp = New Excel.Application xlsWB = xlsApp.Workbooks.Add() <-- error in this line The error message is: "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred " and "Additional information: Old format or invalid type library." I added the Microsoft Excel 9.0 Object Library (excel9.olb) as a reference and use Imports Excel. Anyone give me a suggestion? Thank you

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      It looks like you referenced the Excel 9.0 Object library, but are using the Excel 10 (or better Primary Interop Assemblies). Set the reference to Excel 10.0 instead and see what happens. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        It looks like you referenced the Excel 9.0 Object library, but are using the Excel 10 (or better Primary Interop Assemblies). Set the reference to Excel 10.0 instead and see what happens. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        T Offline
        T Offline
        thanh_bkhn
        wrote on last edited by
        #3

        I'm using Microsoft Office 2000. When this error occurs, I installed the Office 2000 SP3, but the problem still exists

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups