A
Arne Hegefors
Hi! I have a loop that sometimes opens o workbook. when the loop is finished
I want to close that worksbook, if it is open. However I get Err 13 when
trying to close the workbook (which is not a problem here but I becaomes a
problem later so I must solve this). I have checked all the spelling and the
paths to the file but I simply cannot see the probelm. Please help me solve
this.
'here is the file that I open sometimes
Dim strOptionFile As String
Dim strFXOptionPath As String
Dim strRMFXOptionSheet As String
strFXOptionPath = "X:\SCD_RiskManager_Pos\fxOptions\FXOptionFile.xls"
strRMFXOptionSheet = "RM"
''later in the code I check if the workbook is open
If WorkbookIsOpen(strOptionFile) = True Then
Workbooks(strOptionFile).Close
End If
I want to close that worksbook, if it is open. However I get Err 13 when
trying to close the workbook (which is not a problem here but I becaomes a
problem later so I must solve this). I have checked all the spelling and the
paths to the file but I simply cannot see the probelm. Please help me solve
this.
'here is the file that I open sometimes
Dim strOptionFile As String
Dim strFXOptionPath As String
Dim strRMFXOptionSheet As String
strFXOptionPath = "X:\SCD_RiskManager_Pos\fxOptions\FXOptionFile.xls"
strRMFXOptionSheet = "RM"
''later in the code I check if the workbook is open
If WorkbookIsOpen(strOptionFile) = True Then
Workbooks(strOptionFile).Close
End If