Enabling add-in causes excel to crash

3

3

I am using Excel 2007...and saving everything as Office Excel 97-2003
Worksheet. I created an Excel 97-2003 Add-in called CompFxnsAddIn.xla
which contains the code at the bottom of this post.

The code seems to work fine...giving me the expected values, etc (they
are intended to be used on a timeseries in a single column). Anyway,
now everytime I open the file, I get the following notification:
"Excel experienced a serious problem with the CompFxnsAddIn add-in. If
you have seen this message mutiple times you should disable this add-
in and check to see if an update is available. Do you want to disable
this add-in?"

If I click no, Excel crashes. If I click yes, Excel loads. But then
when I go into Excel options/Add-Ins and check the compfxnsaddin box,
Excel crashes.

The only way I was able to get it to load was to enable/install Solver
Add-In and then afterwards it allowed me to enable my add-in.
However, next time I opened the file even disabling and re-enabling
Solver Add-In failed to work. I had to load something else new
(Conditional Sum Wizard) at the same time. Obviously I'm going to run
out of new add-ins to load very soon, but I don't understand what is
happening. I don't believe it has anything to do with the VBA
code....but I posted it just in case.

I was unable to google any other mention of something that seemed
relevant to this....but I am quickly getting fed up with the 20 minute
delays each time I want to get in the file.

Any help???? Please.....

Oh....and I'm running Windows XP.

-------------CompFxnsAddIn.xla
code---------------------------------------

Public Function HigherThanB4(cell As Range, ByVal rowsback As Integer)
As Integer
Dim d1 As Double
Dim d2 As Double

d1 = cell
d2 = cell.Offset(-rowsback)

Select Case d1 > d2
Case True
HigherThanB4 = 1
Case False
HigherThanB4 = 0
End Select
End Function

Public Function LowerThanB4(cell As Range, ByVal rowsback As Integer)
As Integer
Dim d1 As Double
Dim d2 As Double

d1 = cell
d2 = cell.Offset(-rowsback)

Select Case d1 < d2
Case True
LowerThanB4 = 1
Case False
LowerThanB4 = 0
End Select
End Function

Public Function HigherThanMA(cell As Range, ByVal MAperiod As Integer)
As Integer
d1 = cell
d2 = WorksheetFunction.Average(Range(cell, cell.Offset(-MAperiod +
1, 0)))

Select Case d1 > d2
Case True
HigherThanMA = 1
Case False
HigherThanMA = 0
End Select
End Function

Public Function LowerThanMA(cell As Range, ByVal MAperiod As Integer)
As Integer
d1 = cell
d2 = WorksheetFunction.Average(Range(cell, cell.Offset(-MAperiod +
1, 0)))

Select Case d1 < d2
Case True
LowerThanMA = 1
Case False
LowerThanMA = 0
End Select
End Function
 
L

Leith Ross

Hello 3,

Not having Excel 2007 I can't why you're having this problem, but her
a few things to keep in mind. When you create an add-in you need to hav
code that will handle any possible errors. Case in point, if the use
passes rowsback and it it is greater the number of rows to the activ
cell, you will get an error and everything grinds to halt. The othe
problem here that can cause an error is rowsback is typed as an integer
Rows should always be typed as long, unless you are sure you will neve
exceed the integer limit.

Sincerely,
Leith Ros
 
J

Jim Rech

I don't believe it has anything to do with the VBA code

I agree. If that is truly all there is to this add-in I think I try
recreating it from scratch. It may be corrupted.

--
Jim
|I am using Excel 2007...and saving everything as Office Excel 97-2003
| Worksheet. I created an Excel 97-2003 Add-in called CompFxnsAddIn.xla
| which contains the code at the bottom of this post.
|
| The code seems to work fine...giving me the expected values, etc (they
| are intended to be used on a timeseries in a single column). Anyway,
| now everytime I open the file, I get the following notification:
| "Excel experienced a serious problem with the CompFxnsAddIn add-in. If
| you have seen this message mutiple times you should disable this add-
| in and check to see if an update is available. Do you want to disable
| this add-in?"
|
| If I click no, Excel crashes. If I click yes, Excel loads. But then
| when I go into Excel options/Add-Ins and check the compfxnsaddin box,
| Excel crashes.
|
| The only way I was able to get it to load was to enable/install Solver
| Add-In and then afterwards it allowed me to enable my add-in.
| However, next time I opened the file even disabling and re-enabling
| Solver Add-In failed to work. I had to load something else new
| (Conditional Sum Wizard) at the same time. Obviously I'm going to run
| out of new add-ins to load very soon, but I don't understand what is
| happening. I don't believe it has anything to do with the VBA
| code....but I posted it just in case.
|
| I was unable to google any other mention of something that seemed
| relevant to this....but I am quickly getting fed up with the 20 minute
| delays each time I want to get in the file.
|
| Any help???? Please.....
|
| Oh....and I'm running Windows XP.
|
| -------------CompFxnsAddIn.xla
| code---------------------------------------
|
| Public Function HigherThanB4(cell As Range, ByVal rowsback As Integer)
| As Integer
| Dim d1 As Double
| Dim d2 As Double
|
| d1 = cell
| d2 = cell.Offset(-rowsback)
|
| Select Case d1 > d2
| Case True
| HigherThanB4 = 1
| Case False
| HigherThanB4 = 0
| End Select
| End Function
|
| Public Function LowerThanB4(cell As Range, ByVal rowsback As Integer)
| As Integer
| Dim d1 As Double
| Dim d2 As Double
|
| d1 = cell
| d2 = cell.Offset(-rowsback)
|
| Select Case d1 < d2
| Case True
| LowerThanB4 = 1
| Case False
| LowerThanB4 = 0
| End Select
| End Function
|
| Public Function HigherThanMA(cell As Range, ByVal MAperiod As Integer)
| As Integer
| d1 = cell
| d2 = WorksheetFunction.Average(Range(cell, cell.Offset(-MAperiod +
| 1, 0)))
|
| Select Case d1 > d2
| Case True
| HigherThanMA = 1
| Case False
| HigherThanMA = 0
| End Select
| End Function
|
| Public Function LowerThanMA(cell As Range, ByVal MAperiod As Integer)
| As Integer
| d1 = cell
| d2 = WorksheetFunction.Average(Range(cell, cell.Offset(-MAperiod +
| 1, 0)))
|
| Select Case d1 < d2
| Case True
| LowerThanMA = 1
| Case False
| LowerThanMA = 0
| End Select
| End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top