Excel-DNA/IntelliSense

switch sheet -load data error

BigBigRadish opened this issue · 8 comments

when i create two or more sheets,i use udf in one sheet ,quickly ,switch to another sheet,then data loaded on another sheet。i don t know how to make a fix to this bugs

@BigBigRadish Can you explain in a bit more details how I can try to reproduce this, or maybe you can make a little video with something like ScreenToGif?

SheetChangeTest

@govert yes, as your gif show,i want to calculate result loaded current sheet of function,but calculate result loaded another sheet. This problem cause another sheet data was overwrite. i don't how to change it. Look forward to your reply!

@BigBigRadish I'm sorry, I do not understand what you are saying at all.
My gif does not show anything I don't expect - maybe it is not clear because I'm switching back to the original sheet. Perhaps your function is doing something strange?

You will have to explain in much more detail, or show what you are seeing.

OK the problem you have has nothing to do with the IntelliSense.

Your function is dumping data to the sheet - something that cannot be done inside the function since Excel prevents this.
I presume your function is triggering a macro to run after the calculation, but is then not doing it correctly, so is writing to the 'ActiveSheet' instead of the sheet where the function was called from.

I think you will have the problem even if you remove the IntelliSense support.

If you want to expand an array formula to the sheet this way, after calculations have run, then you might consider the ArrayResizer sample from here: https://github.com/Excel-DNA/Samples/tree/master/ArrayResizer

If you just want to write data to the sheet, then you need to fix your code to remember the sheet where the function is called from, and use the right sheet when writing. Since the writing happens only a while after the calculations complete, you cannot be sure that the same sheet that was active when the function was called is still the active when you want to write.

@BigBigRadish I'm closing this issue, since I don't think it is related to this project. Feel free to post a question to the Google group at https://groups.google.com/forum/#!forum/exceldna is you're still stuck with this problem.

@BigBigRadish I'm closing this issue, since I don't think it is related to this project. Feel free to post a question to the Google group at https://groups.google.com/forum/#!forum/exceldna is you're still stuck with this problem.

ok,thank you!