ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro runs fine but error message is displayed (https://www.excelbanter.com/excel-programming/419856-macro-runs-fine-but-error-message-displayed.html)

already

macro runs fine but error message is displayed
 
Hello

I have the following problem. My macro runs fine but I receive the following
error message ' System Error &H80004005 (-2147467259). Unspecified error '

How can I get rid of this message

Kind regards

Al



Bernard Liengme

macro runs fine but error message is displayed
 
I expect the VBA experts could help you if they saw your code!
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"already" wrote in message
...
Hello

I have the following problem. My macro runs fine but I receive the
following
error message ' System Error &H80004005 (-2147467259). Unspecified error
'

How can I get rid of this message

Kind regards

Al





Rick Rothstein

macro runs fine but error message is displayed
 
Given what you have posted, my best guess would be to remove the offending
line of code.<g Perhaps if you showed us your code, and maybe give us a
short description of what it is doing, then maybe we could narrow down our
recommendation a little bit for you.

--
Rick (MVP - Excel)


"already" wrote in message
...
Hello

I have the following problem. My macro runs fine but I receive the
following
error message ' System Error &H80004005 (-2147467259). Unspecified error
'

How can I get rid of this message

Kind regards

Al




already

macro runs fine but error message is displayed
 
Oeps sorry boys
This is the code with an error handler for hiding the error message

Sub testme()
Dim Shp As Shape
Dim InitialShape As Boolean

On Error GoTo ErrHandler:

InitialShape = True
For Each Shp In ActiveSheet.Shapes
If Shp.Name = Range("N1").Value Then '
'skip it
Else
Shp.Select Replace:=InitialShape
InitialShape = False
End If
Next Shp
ErrHandler: Exit Sub

End Sub

Kind regards

Al



"Rick Rothstein" wrote:

Given what you have posted, my best guess would be to remove the offending
line of code.<g Perhaps if you showed us your code, and maybe give us a
short description of what it is doing, then maybe we could narrow down our
recommendation a little bit for you.

--
Rick (MVP - Excel)


"already" wrote in message
...
Hello

I have the following problem. My macro runs fine but I receive the
following
error message ' System Error &H80004005 (-2147467259). Unspecified error
'

How can I get rid of this message

Kind regards

Al





Rick Rothstein

macro runs fine but error message is displayed
 
I did a quick test of your code and it did not generate any errors; however,
that may be because you have other objects that are affecting the code in
some way. However, I do note that you have InitialShape declared as a
Boolean and are using it as the assignment value to the Replace argument of
the shape's Select method... the help files say that the Replace object
takes an Object, not a Boolean, so that may have something to do with your
problem (I have not used the Replace argument with a shape's Select method
before, so I'm not entirely clear what is supposed to be replaced here). I
also note that your Error Handler simply executes an Exit Sub statement...
given that, you don't really need it... jumping to the error handler's label
will execute the following statement so if there is nothing following that
label, the End Sub is executed and the macro ends at that point.

--
Rick (MVP - Excel)


"already" wrote in message
...
Oeps sorry boys
This is the code with an error handler for hiding the error message

Sub testme()
Dim Shp As Shape
Dim InitialShape As Boolean

On Error GoTo ErrHandler:

InitialShape = True
For Each Shp In ActiveSheet.Shapes
If Shp.Name = Range("N1").Value Then '
'skip it
Else
Shp.Select Replace:=InitialShape
InitialShape = False
End If
Next Shp
ErrHandler: Exit Sub

End Sub

Kind regards

Al



"Rick Rothstein" wrote:

Given what you have posted, my best guess would be to remove the
offending
line of code.<g Perhaps if you showed us your code, and maybe give us a
short description of what it is doing, then maybe we could narrow down
our
recommendation a little bit for you.

--
Rick (MVP - Excel)


"already" wrote in message
...
Hello

I have the following problem. My macro runs fine but I receive the
following
error message ' System Error &H80004005 (-2147467259). Unspecified
error
'

How can I get rid of this message

Kind regards

Al







All times are GMT +1. The time now is 06:51 AM.

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