Roland Hoelscher
New Member
- Joined
- Oct 15, 2022
- Messages
- 12
- Office Version
- 365
- Platform
- Windows
Sometimes when I reference a UserForm in my VBA code I get error message "Subscript Out of range". The UserForm which is referenced clearly exists; so I don't understand what is wrong with my code.
Here is a code snippet where I get the error "Subscript out of range". When I click on "Debug" the error points to the code line at the end "frmSelectFolder.show".
Can you help me understand what I'm doing wrong.
Thank you
Sub StartSummaryFile()
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'=== Module Name : ===
'=== Date Created : ===
'=== Author : Roland Hoelscher ===
'=== Summary Description : ===
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'
Application.ScreenUpdating = False
'
strVbaWorkbookName = Worksheets("SETTINGS").Cells(4, 3).Value
'
strDetailedLoggingYesNo = ThisWorkbook.Worksheets("SETTINGS").Cells(6, 3).Value
strSummaryFileName = ThisWorkbook.Worksheets("SETTINGS").Cells(8, 3).Value
strSummaryWorkbookName = Left(strSummaryFileName, Len(strSummaryFileName) - 5)
strDefaultFolder = ThisWorkbook.Worksheets("SETTINGS").Cells(7, 3).Value
'
lngTotalNumberOfRecords = 0
strModuleRef = "Create Summary File"
'
strLogMessageText = "Program started (" & Application.UserName & ")"
strLogMessageType = "N"
WriteLogRecord
'
frmProgress.Show vbModeless
frmProgress.lblProgress.Width = 1
frmProgress.lblProgress.Visible = True
frmProgress.Repaint
'
frmSelectFolder.Show
'
End Sub
Here is a code snippet where I get the error "Subscript out of range". When I click on "Debug" the error points to the code line at the end "frmSelectFolder.show".
Can you help me understand what I'm doing wrong.
Thank you
Sub StartSummaryFile()
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'=== Module Name : ===
'=== Date Created : ===
'=== Author : Roland Hoelscher ===
'=== Summary Description : ===
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'
Application.ScreenUpdating = False
'
strVbaWorkbookName = Worksheets("SETTINGS").Cells(4, 3).Value
'
strDetailedLoggingYesNo = ThisWorkbook.Worksheets("SETTINGS").Cells(6, 3).Value
strSummaryFileName = ThisWorkbook.Worksheets("SETTINGS").Cells(8, 3).Value
strSummaryWorkbookName = Left(strSummaryFileName, Len(strSummaryFileName) - 5)
strDefaultFolder = ThisWorkbook.Worksheets("SETTINGS").Cells(7, 3).Value
'
lngTotalNumberOfRecords = 0
strModuleRef = "Create Summary File"
'
strLogMessageText = "Program started (" & Application.UserName & ")"
strLogMessageType = "N"
WriteLogRecord
'
frmProgress.Show vbModeless
frmProgress.lblProgress.Width = 1
frmProgress.lblProgress.Visible = True
frmProgress.Repaint
'
frmSelectFolder.Show
'
End Sub