Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calling procedures in .xla projects

Hi Rob,

I was wondering if I could pick your brain a bit more on
the solver...

I'm experiencing some solver errors that are making me
pull my hair out, even after using your suggestions. I
see
"Solver: An unexpected internal error occured has
occured, or available memory was exhausted."
on a semi-random basis. I find that when I toggle the
add-in.installed property (not at run time), I'm able to
get the solver to work correctly. However when I try to
code the property change, I get the same error. Do you
have any knowledge about the solver that would help me??

Thanks a lot!
Chris



-----Original Message-----
Hi Steve,

I've copied some code below that handles Solver,

which is the more
complicated case. It's more complicated because it's a

demand-loaded add-in,
so even if the user has it checked in the Tools/Add-Ins

menu it isn't
necessarily open. The last two lines are a trick I use

to force it open.

Dim szSolverName As String
''' Determine if the Solver is installed on this

computer.
On Error Resume Next
szSolverName = Application.AddIns("Solver Add-

in").Name
On Error GoTo 0
''' If Solver was not located, error out.
If Len(szSolverName) = 0 Then
MsgBox "Solver not installed!"
Exit Sub
End If
''' If Solver was located, ensure that Solver.xla is

open.
Application.AddIns("Solver Add-in").Installed = False
Application.AddIns("Solver Add-in").Installed = True

For non-demand loaded add-ins (almost everything

else I've come across),
the logic is exactly the same, but you don't need the

second to last line,
because these will always physically open when you

install them.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Steve" wrote in

message
...
I have several functions/routines that are located in
library .xla files (particularly solver.xla and
atpvbaen.xla), and when working on other systems I

often
get "macro not found" errors (when I say "often", I

mean
in a seemingly random fashion). I have the references
set in my project accordingly.

Does anyone have any advice on systematically avoiding
these types of errors, and also detecting if the .xla
files are missing in order to fail gracefully?

Any advice would be appreciated,
Steve



.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Calling procedures in .xla projects

Hi Chris,

In the only project where I personally experienced this error I was able
to solve it by calling the Solver Auto_Open procedure prior to doing
anything with Solver. I have had some feedback from other people that this
works for them and some that it doesn't, so there's clearly more than one
thing that can cause this problem. You might try this and see if you get
luck, though.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Chris" wrote in message
...
Hi Rob,

I was wondering if I could pick your brain a bit more on
the solver...

I'm experiencing some solver errors that are making me
pull my hair out, even after using your suggestions. I
see
"Solver: An unexpected internal error occured has
occured, or available memory was exhausted."
on a semi-random basis. I find that when I toggle the
add-in.installed property (not at run time), I'm able to
get the solver to work correctly. However when I try to
code the property change, I get the same error. Do you
have any knowledge about the solver that would help me??

Thanks a lot!
Chris



-----Original Message-----
Hi Steve,

I've copied some code below that handles Solver,

which is the more
complicated case. It's more complicated because it's a

demand-loaded add-in,
so even if the user has it checked in the Tools/Add-Ins

menu it isn't
necessarily open. The last two lines are a trick I use

to force it open.

Dim szSolverName As String
''' Determine if the Solver is installed on this

computer.
On Error Resume Next
szSolverName = Application.AddIns("Solver Add-

in").Name
On Error GoTo 0
''' If Solver was not located, error out.
If Len(szSolverName) = 0 Then
MsgBox "Solver not installed!"
Exit Sub
End If
''' If Solver was located, ensure that Solver.xla is

open.
Application.AddIns("Solver Add-in").Installed = False
Application.AddIns("Solver Add-in").Installed = True

For non-demand loaded add-ins (almost everything

else I've come across),
the logic is exactly the same, but you don't need the

second to last line,
because these will always physically open when you

install them.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Steve" wrote in

message
...
I have several functions/routines that are located in
library .xla files (particularly solver.xla and
atpvbaen.xla), and when working on other systems I

often
get "macro not found" errors (when I say "often", I

mean
in a seemingly random fashion). I have the references
set in my project accordingly.

Does anyone have any advice on systematically avoiding
these types of errors, and also detecting if the .xla
files are missing in order to fail gracefully?

Any advice would be appreciated,
Steve



.



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
Calling Procedures from another excel sheet by passing objects Thomas Auburn Excel Programming 0 May 5th 04 05:33 PM
Calling Procedures jrh Excel Programming 2 March 4th 04 03:34 PM
ListBox Procedures Rockee052[_48_] Excel Programming 1 February 20th 04 09:20 AM
How to become a better programmer, post college. More projects or less projects. Matt Somers Excel Programming 1 February 12th 04 01:54 PM
Splitting Procedures Markus Excel Programming 4 August 26th 03 05:47 PM


All times are GMT +1. The time now is 09:09 AM.

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

About Us

"It's about Microsoft Excel"