Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
446 Views, 5 Replies

osheet

i have some coding and keep getting the error "oSheet" is not declared coding below

 

SyntaxEditor Code Snippet

'START 
Quit=MessageBox.Show("Do you wish to run this rule?","title",MessageBoxButtons.YesNo)
If Quit=7 Then
Exit Sub
End If

       TableCheck:'------------------------------------------------------'---------------start finding the table----------------'------------------------------------------------------
For i = 1 To oSheet.CustomTables.Count
    TableTitle = oSheet.CustomTables.Item(i).Title                       
    If TableTitle = "Operating Conditions" Then
        'Remember the table number for editing section
        TableNr = i
        'If table found jump to edit section
        Goto EditTable
    End If
Next
'------------------------------------------------------'---------------end finding the table----------------'------------------------------------------------------

'CreateTable:'------------------------------------------------------'---------------start creating the table---------------'------------------------------------------------------' Set the column titles
oTitles = New String(){"Item", "Description"}'
'
'
' Create the custom table
oCustomTable = oSheet.CustomTables.Add("Operating Conditions", ThisApplication.TransientGeometry.CreatePoint2d(15, 15), _
                                    2, 11, oTitles,oContents, oColumnWidths)
'------------------------------------------------------'---------------finish creating the table---------------'------------------------------------------------------'edit the table by restarting the check routine
Goto TableCheck


EditTable:'------------------------------------------------------'---------------start editing the table---------------'------------------------------------------------------'Get the name Of the first model in the drawing
modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
'MessageBox.Show(modelName, "ilogic")'
'
'
'
'------------------------------------------------------'---------------finish editing the table---------------'------------------------------------------------------