VB.net Help...Like in a bad way
j
Sterling Heights, MI Icrontian
I have a VB.net application that opens an excel file and writes to some cells. It's using the Microsoft office excel 11.0 referance. It works great on my PC. It is running windows XP and Office 2003. I created a deployment package and installed it on my PC and another XP machine and both worked great. However, when I install it on a windows 2000 machine with Office 2003 it gives me a System.runtime.interopservice.Comexception error.
What am I missing? Please for the love of all things Binary I need help.
Here is some code snippits
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
Inherits System.Windows.Forms.Form
Dim MyExcel As New Excel.Application 'create new excel object
Dim WB As Excel.Workbook 'Make a workbook instance
Dim WBsheet As Excel.Worksheet 'make a worksheet instance
///....
This is were the exception is pointing too..Only on the 2000 machines.
Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
///....
If (Log = True) Then
DataLog = DataLog + 1
WBsheet.Cells(DataLog, 1) = Time / 1000
WBsheet.Cells(DataLog, 2) = RawData
WBsheet.Cells(DataLog, 3) = AverageData
WBsheet.Cells(DataLog, 4) = AverageNum
WBsheet.Cells(DataLog, 5) = DynamicBottom
WBsheet.Cells(DataLog, 6) = ActivationBottom
WBsheet.Cells(DataLog, 7) = ValveCondition
End If
End Sub
What am I missing? Please for the love of all things Binary I need help.
Here is some code snippits
Imports Excel = Microsoft.Office.Interop.Excel
Public Class Form1
Inherits System.Windows.Forms.Form
Dim MyExcel As New Excel.Application 'create new excel object
Dim WB As Excel.Workbook 'Make a workbook instance
Dim WBsheet As Excel.Worksheet 'make a worksheet instance
///....
This is were the exception is pointing too..Only on the 2000 machines.
Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
///....
If (Log = True) Then
DataLog = DataLog + 1
WBsheet.Cells(DataLog, 1) = Time / 1000
WBsheet.Cells(DataLog, 2) = RawData
WBsheet.Cells(DataLog, 3) = AverageData
WBsheet.Cells(DataLog, 4) = AverageNum
WBsheet.Cells(DataLog, 5) = DynamicBottom
WBsheet.Cells(DataLog, 6) = ActivationBottom
WBsheet.Cells(DataLog, 7) = ValveCondition
End If
End Sub
0
Comments
Open admin tools -> component services and see what you have on both machines and compare if you are missing a com component.
Additionally, if you can install visual studio .net onto the Win2K box, check if VS.net can see the reference you added.
Works.
WBsheet.Range("a" & DataLog, "a" & DataLog).Value = Time / 1000
Does not work.
WBsheet.Cells(DataLog, 1) = Time / 1000
Funny thing is "WBsheet.Cells(DataLog, 1) = Time / 1000" works on XP, but not 2000. F%^k'n microsoft