Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error handling on Workbooks.Open Tom Excel Programming 2 December 7th 07 04:00 PM
Error trap on Workbooks.Open Barb Reinhardt Excel Programming 1 July 20th 06 02:09 PM
workbooks.open and error handling John Keith[_2_] Excel Programming 5 August 18th 05 05:16 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
error on oXL.Workbooks.Open arieribbens Excel Programming 3 April 26th 04 10:09 AM


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"