ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling Error Messages (https://www.excelbanter.com/excel-programming/298030-disabling-error-messages.html)

ChrisM[_2_]

Disabling Error Messages
 
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library' from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel files)
and when the WorkBooks.Open command gets executed, I get a messagebox from
the App object: 'Compile Error in hidden module : someModule <OK <HELP'

Does anyone know a way that I can avoid these messageboxes popping up? (The
fact that there are some compile errors in the code has no bearing on what I
am trying to do with this application, so I really want to completly ignore
them, but if necessary, I don't mind handling the error and doing somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM



ChrisM[_2_]

Disabling Error Messages
 
Hi,

I had already tried that before posting my original message:
Didn't help...

Any more ideas? ;-)

ChrisM

"NickHK" wrote in message
...
ChrisM,
Application.DisplayAlerts=False

NickHK

"ChrisM" wrote in message
...
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library'

from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel

files)
and when the WorkBooks.Open command gets executed, I get a messagebox

from
the App object: 'Compile Error in hidden module : someModule <OK

<HELP'

Does anyone know a way that I can avoid these messageboxes popping up?

(The
fact that there are some compile errors in the code has no bearing on

what
I
am trying to do with this application, so I really want to completly

ignore
them, but if necessary, I don't mind handling the error and doing

somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM







Don Guillett[_4_]

Disabling Error Messages
 
Try unchecking addins
Look here
http://tinyurl.com/32pey

--
Don Guillett
SalesAid Software

"ChrisM" wrote in message
...
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library' from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel files)
and when the WorkBooks.Open command gets executed, I get a messagebox from
the App object: 'Compile Error in hidden module : someModule <OK <HELP'

Does anyone know a way that I can avoid these messageboxes popping up?

(The
fact that there are some compile errors in the code has no bearing on what

I
am trying to do with this application, so I really want to completly

ignore
them, but if necessary, I don't mind handling the error and doing somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM





ChrisM[_2_]

Disabling Error Messages
 
Hi Don,

A good answer, but unless I've missed the point, not one that can help me in
this situation...

Looking at the URL you posted, the suggestions given for my problem involve
manually doing things to the excel workbooks through excel itself.
That is not really in option in my case as we will be receiving these files
on a regular basis and it woun't really be practical to perform these
operations on each and every file...

What I'm trying to do is open the excel file via VB6. All I want is for the
Application Object to withhold the error messages...

Thanks again for your suggestion.

Cheers,

ChrisM

"Don Guillett" wrote in message
...
Try unchecking addins
Look here
http://tinyurl.com/32pey

--
Don Guillett
SalesAid Software

"ChrisM" wrote in message
...
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library'

from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel

files)
and when the WorkBooks.Open command gets executed, I get a messagebox

from
the App object: 'Compile Error in hidden module : someModule <OK

<HELP'

Does anyone know a way that I can avoid these messageboxes popping up?

(The
fact that there are some compile errors in the code has no bearing on

what
I
am trying to do with this application, so I really want to completly

ignore
them, but if necessary, I don't mind handling the error and doing

somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM







Jean-Yves[_2_]

Disabling Error Messages
 
Hi Chirs,
from memory

Application.enableEvents=false, just before you open the workbook
will inhibit the firing of the open event
Regards,

Jean-Yves

"ChrisM" wrote in message
...
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library' from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel files)
and when the WorkBooks.Open command gets executed, I get a messagebox from
the App object: 'Compile Error in hidden module : someModule <OK <HELP'

Does anyone know a way that I can avoid these messageboxes popping up?

(The
fact that there are some compile errors in the code has no bearing on what

I
am trying to do with this application, so I really want to completly

ignore
them, but if necessary, I don't mind handling the error and doing somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM





ChrisM[_2_]

Disabling Error Messages
 
Hi Jean-Yves,

Yes!

That seems to have solved the problem.

Many Thanks,

ChrisM.

"Jean-Yves" wrote in message
...
Hi Chirs,
from memory

Application.enableEvents=false, just before you open the workbook
will inhibit the firing of the open event
Regards,

Jean-Yves

"ChrisM" wrote in message
...
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library'

from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel

files)
and when the WorkBooks.Open command gets executed, I get a messagebox

from
the App object: 'Compile Error in hidden module : someModule <OK

<HELP'

Does anyone know a way that I can avoid these messageboxes popping up?

(The
fact that there are some compile errors in the code has no bearing on

what
I
am trying to do with this application, so I really want to completly

ignore
them, but if necessary, I don't mind handling the error and doing

somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM







NickHK[_2_]

Disabling Error Messages
 
ChrisM,
Application.DisplayAlerts=False

NickHK

"ChrisM" wrote in message
...
Hi Group,

I'm just trying for the first time to use the 'Excel Object Library' from
VB6.

I'm using Excel 2002 (Microsoft Excel 10 Object Library)

I have some code similar to the following:

Dim excelApp As Object 'Excel.Application

Set excelApp = CreateObject("EXCEL.APPLICATION")
excelApp.Visible = False
Call excelApp.Workbooks.Open("c:\temp\SomeExcelFile.xls ", False, True)

My problem is this:
Some of the Workbooks that I need to open may contain some invalid code
modules (I can't do anything about this, I didn't create the Excel files)
and when the WorkBooks.Open command gets executed, I get a messagebox from
the App object: 'Compile Error in hidden module : someModule <OK <HELP'

Does anyone know a way that I can avoid these messageboxes popping up?

(The
fact that there are some compile errors in the code has no bearing on what

I
am trying to do with this application, so I really want to completly

ignore
them, but if necessary, I don't mind handling the error and doing somthing
with it, I just don't want these boxes pinging up in the middle of my
application!!)

Thanks,

ChrisM






All times are GMT +1. The time now is 10:27 PM.

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