Fixed previously errors and correctly dispose excel app after use
This commit is contained in:
parent
83c3984c65
commit
0233d1b758
|
|
@ -246,7 +246,7 @@ Partial Class GUI
|
||||||
'Button_Square
|
'Button_Square
|
||||||
'
|
'
|
||||||
Me.Button_Square.Location = New System.Drawing.Point(971, 68)
|
Me.Button_Square.Location = New System.Drawing.Point(971, 68)
|
||||||
Me.Button_Square.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
|
Me.Button_Square.Margin = New System.Windows.Forms.Padding(4)
|
||||||
Me.Button_Square.Name = "Button_Square"
|
Me.Button_Square.Name = "Button_Square"
|
||||||
Me.Button_Square.Size = New System.Drawing.Size(123, 34)
|
Me.Button_Square.Size = New System.Drawing.Size(123, 34)
|
||||||
Me.Button_Square.TabIndex = 25
|
Me.Button_Square.TabIndex = 25
|
||||||
|
|
@ -290,6 +290,7 @@ Partial Class GUI
|
||||||
'CheckBox_WholeMeshWidths
|
'CheckBox_WholeMeshWidths
|
||||||
'
|
'
|
||||||
Me.CheckBox_WholeMeshWidths.AutoSize = True
|
Me.CheckBox_WholeMeshWidths.AutoSize = True
|
||||||
|
Me.CheckBox_WholeMeshWidths.Enabled = False
|
||||||
Me.CheckBox_WholeMeshWidths.Location = New System.Drawing.Point(125, 453)
|
Me.CheckBox_WholeMeshWidths.Location = New System.Drawing.Point(125, 453)
|
||||||
Me.CheckBox_WholeMeshWidths.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2)
|
Me.CheckBox_WholeMeshWidths.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2)
|
||||||
Me.CheckBox_WholeMeshWidths.Name = "CheckBox_WholeMeshWidths"
|
Me.CheckBox_WholeMeshWidths.Name = "CheckBox_WholeMeshWidths"
|
||||||
|
|
@ -328,7 +329,7 @@ Partial Class GUI
|
||||||
Me.Controls.Add(Me.DrawingPanel)
|
Me.Controls.Add(Me.DrawingPanel)
|
||||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
||||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||||
Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
|
Me.Margin = New System.Windows.Forms.Padding(4)
|
||||||
Me.MaximizeBox = False
|
Me.MaximizeBox = False
|
||||||
Me.Name = "GUI"
|
Me.Name = "GUI"
|
||||||
Me.Text = "Floor Gratings"
|
Me.Text = "Floor Gratings"
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
Imports Excel = Microsoft.Office.Interop.Excel
|
Imports Excel = Microsoft.Office.Interop.Excel
|
||||||
|
|
||||||
Public Class GUI
|
Public Class GUI
|
||||||
'Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
|
Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
|
||||||
Public Shared filepath As String = "C:\Users\xperd\Documents"
|
'Public Shared filepath As String = "C:\Users\xperd\Documents"
|
||||||
|
|
||||||
Dim excelApp As Excel.Application = New Excel.Application
|
Dim excelApp As Excel.Application = New Excel.Application
|
||||||
Dim excelWB As Excel.Workbook
|
Dim excelWB As Excel.Workbook
|
||||||
|
|
@ -21,6 +21,8 @@ Public Class GUI
|
||||||
adminClass.loadSettings(GUI_Settings.filesFolder, GUI_Settings.HLCtFolder, "SolidWorks")
|
adminClass.loadSettings(GUI_Settings.filesFolder, GUI_Settings.HLCtFolder, "SolidWorks")
|
||||||
|
|
||||||
Get_Database()
|
Get_Database()
|
||||||
|
|
||||||
|
CheckBox_WholeMeshWidths.Checked = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Get_Database()
|
Private Sub Get_Database()
|
||||||
|
|
@ -54,8 +56,16 @@ Public Class GUI
|
||||||
End While
|
End While
|
||||||
|
|
||||||
dataBase.Add(activeSheet.Name, tempDT)
|
dataBase.Add(activeSheet.Name, tempDT)
|
||||||
|
|
||||||
|
System.Runtime.InteropServices.Marshal.ReleaseComObject(activeSheet)
|
||||||
Next
|
Next
|
||||||
' HANTERA OLIKA LÄNGDER PÅ COLUMNER
|
' HANTERA OLIKA LÄNGDER PÅ COLUMNER
|
||||||
|
|
||||||
|
|
||||||
|
excelWB.Close()
|
||||||
|
excelApp.Quit()
|
||||||
|
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelWB)
|
||||||
|
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Create_TextBox(TextBoxName As String, TextBoxText As String, TextBoxLeft As Integer, TextBoxTop As Integer, TextBoxWidth As Integer)
|
Public Sub Create_TextBox(TextBoxName As String, TextBoxText As String, TextBoxLeft As Integer, TextBoxTop As Integer, TextBoxWidth As Integer)
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,11 @@
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Update_AvalaibleMeshes()
|
Private Shared Sub Update_AvalaibleMeshes()
|
||||||
|
GUI.ComboBox_Height.Items.Clear()
|
||||||
|
GUI.ComboBox_Height.Enabled = False
|
||||||
|
GUI.ComboBox_Thickness.Items.Clear()
|
||||||
|
GUI.ComboBox_Thickness.Enabled = False
|
||||||
|
|
||||||
GUI.ComboBox_MeshSize.Items.Clear()
|
GUI.ComboBox_MeshSize.Items.Clear()
|
||||||
|
|
||||||
Dim meshesDT As DataTable = GUI.dataBase("Meshes")
|
Dim meshesDT As DataTable = GUI.dataBase("Meshes")
|
||||||
|
|
@ -162,6 +167,9 @@
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub MeshChanged(sender As Object, e As EventArgs)
|
Public Shared Sub MeshChanged(sender As Object, e As EventArgs)
|
||||||
|
GUI.ComboBox_Thickness.Items.Clear()
|
||||||
|
GUI.ComboBox_Thickness.Enabled = False
|
||||||
|
|
||||||
GUI.ComboBox_Height.Enabled = True
|
GUI.ComboBox_Height.Enabled = True
|
||||||
GUI.ComboBox_Height.Items.Clear()
|
GUI.ComboBox_Height.Items.Clear()
|
||||||
gratingMesh = GUI.ComboBox_MeshSize.Text
|
gratingMesh = GUI.ComboBox_MeshSize.Text
|
||||||
|
|
@ -207,7 +215,7 @@
|
||||||
Next
|
Next
|
||||||
|
|
||||||
tempList.Sort()
|
tempList.Sort()
|
||||||
For i = 0 To tempList.Count - 2
|
For i = 0 To tempList.Count - 1
|
||||||
GUI.ComboBox_Height.Items.Add(tempList(i))
|
GUI.ComboBox_Height.Items.Add(tempList(i))
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
@ -256,7 +264,7 @@
|
||||||
Next
|
Next
|
||||||
|
|
||||||
tempList.Sort()
|
tempList.Sort()
|
||||||
For i = 0 To tempList.Count - 2
|
For i = 0 To tempList.Count - 1
|
||||||
GUI.ComboBox_Thickness.Items.Add(tempList(i))
|
GUI.ComboBox_Thickness.Items.Add(tempList(i))
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
@ -267,6 +275,8 @@
|
||||||
GUI.ComboBox_Width.Items.Clear()
|
GUI.ComboBox_Width.Items.Clear()
|
||||||
GUI.ComboBox_Length.Enabled = True
|
GUI.ComboBox_Length.Enabled = True
|
||||||
GUI.ComboBox_Length.Items.Clear()
|
GUI.ComboBox_Length.Items.Clear()
|
||||||
|
GUI.CheckBox_WholeMeshWidths.Enabled = True
|
||||||
|
|
||||||
loadBarThickness = CInt(GUI.ComboBox_Thickness.Text)
|
loadBarThickness = CInt(GUI.ComboBox_Thickness.Text)
|
||||||
|
|
||||||
' Add Widths
|
' Add Widths
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue