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. VB.Net to Excel Problem

VB.Net to Excel Problem

Scheduled Pinned Locked Moved Visual Basic
csharpcomtestingbeta-testing
2 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.
  • D Offline
    D Offline
    directred
    wrote on last edited by
    #1

    The following code works on my PC but when I try and run the exe on another PC I get the following message.... An unhandled exception has occurred in your application..... File or assembly name Interop.Excel, or one of it's dependencies, was not found. I added reference Microsoft Excel 8.0 Object Library Here is my code.... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MyExcel As New Excel.Application 'Creating Excel Worksheet Dim WSheet As New Excel.Worksheet 'Adding new worksheet to excel workbooks WSheet = MyExcel.Workbooks.Add.Worksheets.Add 'Writing values in Work Sheet With WSheet 'Cells(row, column) .Cells(1, 1).Value = "TESTING " .Cells(2, 1).Value = "A" .Cells(2, 2).Value = "B" .Cells(2, 3).Value = "C" .Cells(2, 4).Value = "D" End With 'Saving .xls file with Test.xls name WSheet.SaveAs("C:\temp\aTEST.XLS") End Sub

    D 1 Reply Last reply
    0
    • D directred

      The following code works on my PC but when I try and run the exe on another PC I get the following message.... An unhandled exception has occurred in your application..... File or assembly name Interop.Excel, or one of it's dependencies, was not found. I added reference Microsoft Excel 8.0 Object Library Here is my code.... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MyExcel As New Excel.Application 'Creating Excel Worksheet Dim WSheet As New Excel.Worksheet 'Adding new worksheet to excel workbooks WSheet = MyExcel.Workbooks.Add.Worksheets.Add 'Writing values in Work Sheet With WSheet 'Cells(row, column) .Cells(1, 1).Value = "TESTING " .Cells(2, 1).Value = "A" .Cells(2, 2).Value = "B" .Cells(2, 3).Value = "C" .Cells(2, 4).Value = "D" End With 'Saving .xls file with Test.xls name WSheet.SaveAs("C:\temp\aTEST.XLS") End Sub

      D Offline
      D Offline
      Divya Rathi
      wrote on last edited by
      #2

      check if Excel 8.0 is installed on that m/c or some other previos verson is installed Divya Rathi

      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