Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Reference is not valid" error when using analysis toolpak in an add-in
aaarrrggghh, I keep getting an error the FIRST time that the following
line of code executes in an add-in I'm developing.. Application.Run "ATPVBAEN.XLA!Mcorrel", Range(Cells(1, 2), Cells(1, 2).End(xlToRight).End(xlDown)), Sheets("Matrix").Cells(1, 1), "C", True a box pops up saying "Reference is not valid", with an exclamation icon.. the only option is "OK" then the correlation matrix is not created.. the weird thing is, when I turn the file to not be an addin using isaddin = false, the code works fine.. I've checked the ranges given to it in the debugger with the watch window, and at the time the code is executed they refer to the ranges I expect them to with the right values in and so on.. the other weird thing, is I tried to recreate the error using a very simple addin so I could try and work out what was going on, I couldn't, but running the line of code in my test addin (with small simple ranges) meant I stopped getting the error in my actual addin. So I thought I'd put a dummy call to the Mcorrel procedure before the one I neeeded as a workaround, the dummy call worked, then on the actual call, I got the error again, BUT this time the matrix was created correctly, so the code works now, but there is an annoying and pointless dialog box that pops up in the middle all the time, its doing my head in, I can't work out what is going on, and there is no documentation on this error either in the application or on microsofts support pages, its doing my head in. I can't get roiund it with excels normal error handling, because it isn't an excel error, it seems to be just a call to msgbox from within the analysis toolpak so theres no way I can suppress it. If anyone knows how I can fix this I'd be very grateful, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pre-loaded Excel 2007 missing "Analysis ToolPak" | Excel Discussion (Misc queries) | |||
Pivot Table "Data source reference is not valid" error cause? | Excel Discussion (Misc queries) | |||
"Reference not valid" error when I try to edit the macro in excel | Excel Discussion (Misc queries) | |||
Pivot Table - Error "Reference Is Not Valid" | Excel Discussion (Misc queries) | |||
unable to load "Excel" analysis toolpak tried the tools and brows | Excel Discussion (Misc queries) |