View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Kevin Maher Kevin Maher is offline
external usenet poster
 
Posts: 4
Default runtime error 13 - type mismatch error in Excel 97 on Citrix

Thanks for your suggestion, Lewis. I tried that and just like before, it
didn't work in 97 but did work fine in 2000. The code can handle cells that
are blank or don't contain numbers ok - at least, on paper it does - but the
version of Excel seems to determine whether or not it will run successfully.

I mentioned in my reply to Dave Peterson that I did most of my editing in
Excel 2000, so am wondering whether 2000 made some small alteration to the
code/spreadsheet somewhere that 97 can't handle?

Cheers

Kevin

"Lewis" wrote:

Hi Kevin,

It looks to me as if some of your cells do not contain numerical numbers
which is causing the crash. Excel is trying to evaluate the cell for zero
but finding a null or text value of "" instead.

A quick fix is to make sure all numbers have at minimum a zero value to fill
them up.

A better solution is to add some code to evaluate the cell for non-numerical
content first like:

If Isnull(Activecell) = False and ActiveCell.Value = 0 then

I think thats the right code, its awhile since I've done this.

Cheers

"Kevin Maher" wrote:

Hi

I'm getting a "runtime error 13 - type mismatch" error when running a macro
in a spreadsheet on the company network (accessed via Citrix) at the company
I work for. The line causing the error is identified below:

Range("L1").Select
Do Until ActiveCell.Value = ""
If ActiveCell.Value = 0 Then <<--- this line
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

There is more code than this, so can supply that if required.

Citrix may be the cause of the problem because the exact same code works
fine when I open the spreadsheet on my desktop pc (using Excel 2000).

Could someone please explain to me what the problem could be, and how it
could be fixed?

Thanks and regards

Kevin Maher