Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Connection between Solver add-in and file path code

I am having a strange connection between my excel solver add-in and my
file path security macro. I am running an excel file from a server. On
my computer it runs just fine, but from the server there is a problem
linking the solver and file path code.
I have a file path code:

FullPath = ThisWorkbook.FullName
If FullPath < "path\filename.xlsm" Then
MsgBox "This file can only be accessed from the server: " +
FullPath, vbExclamation, "Access Denied"
ActiveWorkbook.Close False
End If

Another piece of code requires excel solver. If I do not have excel
solver installed, then even when I just run this code I get an error
(only from the server). If I install the solver (by checking the box
in add-ins) then this file path code works too. I have the filepath
code in an auto_open sub. I wrote code to automatically install the
solver:

Private Sub Workbook_Open()
If AddIns("Solver Add-in").Installed = False Then
AddIns("Solver Add-in").Installed = True
End If
End Sub

This code seems to work, and I can see that solver is installed, but
then the filepath code still doesn't work. The filepath code only
works when I manually install the solver. I thought it might be an
order issue. I moved the filepath code to a different macro and had it
run after opening the workbook and it still doesn't work. The filepath
code only works when I manually install the solver before the code is
run, or if I have the macro install the solver and then close and re-
open the file. It doesn't run when I have the macro install solver and
then either automatically or manually run the filepath macro.

Any ideas as to why this is a problem?
Also, if I have the macro install the solver and then I go through the
filepath code step by step the macro works just fine.
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
File Path Too Long? Not Anymore! Check out Long Path Tool Max Loger Excel Discussion (Misc queries) 1 March 24th 17 07:59 AM
Relative Path in Connection String Breunus Excel Discussion (Misc queries) 2 July 29th 09 05:10 PM
Relative path in database query connection string DanL Excel Discussion (Misc queries) 1 February 20th 09 06:09 PM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
variable for path name in ODBC connection MOI_Jim Excel Programming 2 April 12th 05 10:33 PM


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

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"