Results 1 to 6 of 6

Thread: Problem with Compiling

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    4

    Problem with Compiling

    I have Visual Basic 2010 program that suddenly started giving me an error message as such

    Cannot find wrapper assembly for type library "VBIDE"

    The code normally opens 3 csv files in Excel and reads the files for information based on user selected info.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Problem with Compiling

    It sounds like something has been corrupted. You might want to restore a backup if you have one (and start creating them if you don't) or create a new project and import the code files into it to see if that helps.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    4

    Re: Problem with Compiling

    I think its a problem with some weird reference library in conjunction with the Excel Interop functions in the Visual Studio compiler

    I just tried to run a similar but completely separate project and it gave me the same exact problem.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Problem with Compiling

    I was assuming that VBIDE was a reference to Visual Studio but, now that you say that, it may have something to do with the VBA functionality in Excel. You should probably post your code so we can see if we can reproduce the issue. If we can't then it may well be corruption, but in Excel/Office rather than your project. An Office reinstall may not be a bad idea.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    4

    Re: Problem with Compiling

    Here is some of the code that is giving me problems.
    The code sets the background image of a subsequent form to a jpg file in the Model Regression folder. It then uses Excel to open 3 csv files for subsequent reading.

    Public Class FrmInitial
    Public TwoEvap As Double

    Public ExcelApp As New Microsoft.Office.Interop.Excel.Application
    Public ExcelWBcomp As Microsoft.Office.Interop.Excel.Workbook
    Public ExcelWBevap As Microsoft.Office.Interop.Excel.Workbook
    Public ExcelWBcond As Microsoft.Office.Interop.Excel.Workbook
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    TwoEvap = 0
    FrmOutput.Show()
    FrmOutput.BackgroundImage = Image.FromFile("C:\Documents and Settings\Model Regression\Flow Diagrams\1 Evap.jpg")
    FrmOutput.BackgroundImageLayout = ImageLayout.None
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    TwoEvap = 1
    FrmOutput.Show()
    FrmOutput.BackgroundImage = Image.FromFile("C:\Documents and Settings\Model Regression\Flow Diagrams\2 Evap.jpg")
    FrmOutput.BackgroundImageLayout = ImageLayout.None
    End Sub
    Private Sub FrmInitial_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    '---OPENS THE COMPRESSOR EVAPORATOR CONDENSER COEFFICIENT FILES---
    ExcelApp.Visible = True
    ExcelWBcomp = ExcelApp.Workbooks.Open(Filename:="C:\Documents and Settings\Model Regression\Compressors\Compressor_Coefficients.csv")
    ExcelWBevap = ExcelApp.Workbooks.Open(Filename:="C:\Documents and Settings\Model Regression\Evaporators\Evaporator_Coefficients.csv")
    ExcelWBcond = ExcelApp.Workbooks.Open(Filename:="C:\Documents and Settings\Model Regression\Condensors\Condenser_Coefficients.csv")

    End Sub
    Private Sub FrmInitial_FormClosed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.FormClosed

    Dim proc As System.Diagnostics.Process

    '---OPENS A MESSAGE BOX TELLING THE USER TO SAVE ALL EXCEL FILES---
    MsgBox("Save All Open Excel Workbooks Before Clicking OK", vbExclamation Or vbOKOnly, "Attention")

    '---VERIFIES AND CLOSES ALL INSTANCES OF EXCEL (EXCEL.EXE) IN THE TASK QUEUE TO FREE-UP COMPUTER RAM---
    System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelApp)
    For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")
    proc.Kill()
    Next

    '---ENDS THE PROGRAM---
    End

    End Sub

  6. #6

    Thread Starter
    New Member
    Join Date
    Feb 2011
    Posts
    4

    Re: Problem with Compiling

    I tried three different approaches to fix the problem
    1) I deleted the Excel/Office .dll library references and then re-added them. That didn't work,
    2) I commented out all references to the Excel Interop calls.
    That didn't work
    3) I uninstalled Visual Basic Express 2010 and re-installed it.
    That didn't work.

    There is something corrupted with that particular instance of the compiler.
    The last executable file the program compiled still works so I know it is not anything with the 4.0 version of the .NET framework.

    Honestly, I'm at the point of starting over from scratch with the program.

    I have a few new approaches anyway that I want to implement in the program.

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