Open file macro
Hi ,
I need to load a TIF file during the macro execution.
This is the code I use (it works fine)
I need to load a TIF file during the macro execution.
This is the code I use (it works fine)
Public Function bianco() As SimpleScript
bianco = New SimpleScript
Dim docList1 = New List(1), doc1
With Application.DocumentCommands.Open(bianco)
.Filenames = New String() {"C:\App_Iec\bianco1.tif"}
.Run(docList1)
End With
With Application.DocumentCommands.Activate(bianco)
.Run(docList1(0), doc1)
End With
End Function
Is there possible to intercept any error (eg file not found) without showing error dialog box?
I would like to manage the error internally without stop the macro execution
than yuo
Maurizio
0
Answers
You can use try/catch block to handle the error yourself, but it would be easier just to check if the file exists before trying to open it, like this:
Yuri