ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error 13 in 'WorkBooks.open' (https://www.excelbanter.com/excel-programming/421298-error-13-workbooks-open.html)

Zayas

Error 13 in 'WorkBooks.open'
 
I distribute by Internet a free program and sometimes it happens the
strange error that I describe:

I have an Excel workbook and one of the macros open another workbook.
I do not know why, when the macro open the second workbook, some
times, occurs an "error 13".
Somebody has idea that it can happen?

Dim FileToOpen1 As String
FileToOpen1 = "C:\Files\ExcelData.xls"
Workbooks.Open Filename:=FileToOpen1


Thanks in advance.

Zayas

Peter T

Error 13 in 'WorkBooks.open'
 
#13 is a type mismatch error, I doubt directly raised on the Workbooks.Open
line but somewhere else. If you haven't included an error handler normally
the code will break on the problematic code line.

Regards,
Peter T

"Zayas" wrote in message
...
I distribute by Internet a free program and sometimes it happens the
strange error that I describe:

I have an Excel workbook and one of the macros open another workbook.
I do not know why, when the macro open the second workbook, some
times, occurs an "error 13".
Somebody has idea that it can happen?

Dim FileToOpen1 As String
FileToOpen1 = "C:\Files\ExcelData.xls"
Workbooks.Open Filename:=FileToOpen1


Thanks in advance.

Zayas




Zayas

Error 13 in 'WorkBooks.open'
 
On 14 dic, 12:54, "Peter T" <peter_t@discussions wrote:
#13 is a type mismatch error, I doubt directly raised on the Workbooks.Open
line but somewhere else. If you haven't included an error handler normally
the code will break on the problematic code line.

Regards,
Peter T

"Zayas" wrote in message

...



I distribute by Internet a free program and sometimes it happens the
strange error that I describe:


I have an Excel workbook and one of the macros open another workbook.
I do not know why, when the macro open the second workbook, some
times, occurs an "error 13".
Somebody has idea that it can happen?


Dim FileToOpen1 As String
FileToOpen1 = "C:\Files\ExcelData.xls"
Workbooks.Open Filename:=FileToOpen1


Thanks in advance.


Zayas- Ocultar texto de la cita -


- Mostrar texto de la cita -


I have an error handler. It seems incredible but it gives error 13
(type mismatch) in the 'Workbooks.Open Filename:=FileToOpen1' line.

Chip Pearson

Error 13 in 'WorkBooks.open'
 
If you have error handling set to "Trap Unhandled Errors" (in VBA,
Tools menu, Options item, General tab) and an error occurs in an
object module (a Class, UserForm, or Sheet or ThisWorkbook module),
VBA marks the line that called the object module as being in error,
even though the actual error occurred in the object module. For
example, if you have code in Class1 that causes an error, the code in
a standard module that called the code in Class1 will be marked as the
error. This can mask the true source of the error.

You should always run your code with the "Break In Class Module"
option in effect. This causes VBA to show the error in the object
module, where it really occurred, rather than in the calling code.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sun, 14 Dec 2008 04:07:03 -0800 (PST), Zayas
wrote:

On 14 dic, 12:54, "Peter T" <peter_t@discussions wrote:
#13 is a type mismatch error, I doubt directly raised on the Workbooks.Open
line but somewhere else. If you haven't included an error handler normally
the code will break on the problematic code line.

Regards,
Peter T

"Zayas" wrote in message

...



I distribute by Internet a free program and sometimes it happens the
strange error that I describe:


I have an Excel workbook and one of the macros open another workbook.
I do not know why, when the macro open the second workbook, some
times, occurs an "error 13".
Somebody has idea that it can happen?


Dim FileToOpen1 As String
FileToOpen1 = "C:\Files\ExcelData.xls"
Workbooks.Open Filename:=FileToOpen1


Thanks in advance.


Zayas- Ocultar texto de la cita -


- Mostrar texto de la cita -


I have an error handler. It seems incredible but it gives error 13
(type mismatch) in the 'Workbooks.Open Filename:=FileToOpen1' line.


Zayas

Error 13 in 'WorkBooks.open'
 
On 14 dic, 14:57, Chip Pearson wrote:
If you have error handling set to "Trap Unhandled Errors" (in VBA,
Tools menu, Options item, General tab) and an error occurs in an
object module (a Class, UserForm, or Sheet *or ThisWorkbook module),
VBA marks the line that called the object module as being in error,
even though the actual error occurred in the object module. For
example, if you have code in Class1 that causes an error, the code in
a standard module that called the code in Class1 will be marked as the
error. This can mask the true source of the error.

You should always run your code with the "Break In Class Module"
option in effect. This causes VBA to show the error in the object
module, where it really occurred, rather than in the calling code.

Cordially,
Chip Pearson
Microsoft MVP
* * Excel Product Group
Pearson Software Consulting, LLCwww.cpearson.com
(email on web site)

On Sun, 14 Dec 2008 04:07:03 -0800 (PST), Zayas



wrote:
On 14 dic, 12:54, "Peter T" <peter_t@discussions wrote:
#13 is a type mismatch error, I doubt directly raised on the Workbooks..Open
line but somewhere else. If you haven't included an error handler normally
the code will break on the problematic code line.


Regards,
Peter T


"Zayas" wrote in message


....


I distribute by Internet a free program and sometimes it happens the
strange error that I describe:


I have an Excel workbook and one of the macros open another workbook..
I do not know why, when the macro open the second workbook, some
times, occurs an "error 13".
Somebody has idea that it can happen?


Dim FileToOpen1 As String
FileToOpen1 = "C:\Files\ExcelData.xls"
Workbooks.Open Filename:=FileToOpen1


Thanks in advance.


Zayas- Ocultar texto de la cita -


- Mostrar texto de la cita -


I have an error handler. It seems incredible but it gives error 13
(type mismatch) in the 'Workbooks.Open Filename:=FileToOpen1' line.- Ocultar texto de la cita -


- Mostrar texto de la cita -



Thank you very much, I will do it.

Zayas


All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com