Function CreatePicture(Width As Long, Height As Long) As StdPicture
' Creates a blank picture of specified size
' ... [implementation]
End Function
Sub LogError(errNum As Long, errDesc As String, procName As String)
' Log errors to a dedicated worksheet
On Error Resume Next ' Prevent infinite loop if error occurs here
Dim wsLog As Worksheet
Set wsLog = [Link]("ErrorLog")
If wsLog Is Nothing Then
Set wsLog =
[Link](After:=[Link]([Link]
[Link]))
[Link] = "ErrorLog"
[Link](1, 1).Value = "Timestamp"
[Link](1, 2).Value = "Error Number"
[Link](1, 3).Value = "Error Description"
[Link](1, 4).Value = "Procedure"
End If
Dim nextRow As Long
nextRow = [Link]([Link], 1).End(xlUp).Row + 1
[Link](nextRow, 1).Value = Now
[Link](nextRow, 2).Value = errNum
[Link](nextRow, 3).Value = errDesc
[Link](nextRow, 4).Value = procName
[Link]("A:D").AutoFit
End Sub
Key Enhancements in This Version:
1. Improved Visualization:
o Uses Windows API calls for proper drawing (lines, circles, etc.)
o Shows both original and deformed shapes (with adjustable scale)
o Better coordinate system handling and scaling
2. Robust Analysis Engine:
o Supports both direct and iterative solvers
o Comprehensive error handling for singular matrices
o Detailed error logging to worksheet
3. Enhanced Results Reporting:
o Creates formatted worksheets with results tables
o Includes nodal displacements, reactions, and element forces
o Automatic formatting as Excel tables
4. Extended Analysis Capabilities:
o Support for both 2D and 3D analysis (switchable via UI)
o Handles both frame and truss elements
o Configurable solver options
5. Better User Interface:
P a g e 61 | 62