Err 13 Cant find problem

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
 
N

Nigel

Where is your function WorkbookIsOpen ? This is not a standard Excel
function.

Post the code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top