ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   error 50290 when working from dll (https://www.excelbanter.com/excel-programming/317201-error-50290-when-working-dll.html)

PM

error 50290 when working from dll
 
Hi !

This simple code hides all lines except the selected line:

For i = 1 To nb_questions
.Rows(1 + i).RowHeight = 0
Next
.Rows(selection.Row).RowHeight = h

It works fine in VBA.

The same code generates an error when placed in a compiled dll.

I tested the code opening the dll and then Excel and going through step by
step with F8.
In my first testing, the most unusual thing happened : the program hid all
lines (the first part worked !) and then it crashed on the last line giving
error 50290 Application Defined or object defined error .

Now it works in this setting (dll runing in VB6, nothing changed (!)) but
crashes with the compiled dll (VB6 closed).
This goes far beyond my limited understanding.
Any help would be very much appreciated.

Pat.

PS. I've looked up some previous exchanges. Answers refer to Excel not being
ready because of other tasks. They do not seem to fit with such a simple
case as the above although I must say the above code is called by a
contextual menu (right-clic) which is provided by the dll (although
earlier).




All times are GMT +1. The time now is 05:11 PM.

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