Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default "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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pre-loaded Excel 2007 missing "Analysis ToolPak" mapjo11 Excel Discussion (Misc queries) 2 May 23rd 10 02:49 AM
Pivot Table "Data source reference is not valid" error cause? Bill Neurohr Excel Discussion (Misc queries) 1 March 11th 09 10:16 PM
"Reference not valid" error when I try to edit the macro in excel Yuvaraj Excel Discussion (Misc queries) 1 January 10th 08 08:32 PM
Pivot Table - Error "Reference Is Not Valid" Olly Excel Discussion (Misc queries) 0 May 22nd 07 09:27 AM
unable to load "Excel" analysis toolpak tried the tools and brows excel analysis toolpak Excel Discussion (Misc queries) 4 November 11th 05 05:01 AM


All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"