Basically I have a form that I want to auto populate based on the results of some boolean statements. Such as "IF true then celcius radiobutton is checked"
What I have so far is the following
Public Class Unitsofmeasureform Dim oForm As Unitsofmeasureform
Public Sub Load_Units_Form()
'Dim ws As Object
'ws = Application.activesheet()
Dim xlApp
xlApp = Application
Dim temp_units As String
If IsNothing(oForm) OrElse oForm.IsDisposed Then
oForm = New Unitsofmeasureform()
End If
oForm.Show()
temp_units = Application.Sheets("units sheet").Range("D1").value
If temp_units = "°C" Then
Application.Sheets("sheet1").range("A1") = 1
Me.celcius.Checked = True
Else
Application.Sheets("sheet1").range("A1") = 2
Me.fahrenheit.Checked = True
End If
End Sub
I am using a program called ExcelDNA to integrate this VB.net form into excel and I have included to the range information to ensure that the if statement works. However when the form reloads the radiobutton with the tag celcius is no checked. nor is it checked when i repeat the code without "Me."
found my own solution
change the
Me.celcius.Checked = True
to
oForm.celcius.Checked = True
then this works