Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Addin loads but functions don't work

I have a spreadsheet that has a number of calls to functions that are
contained in an add-in. My users start up the spreadsheet by browsing to the
directory and double-clicking the .xls file. They fill in financial
information, then save the file under a different name. So the original file
is really just a read-only template. What I want to happen is that whenever
they open the template file, or any of the modified files, it will check to
see if the addin is loaded and, if not, load it. For various reasons I don't
really want the add-in loaded permanently; just when one of these
spreadsheets is opened.

I've tried putting the code in the workbook_open event of the spreadsheet
that seems to load the add-in when necessary, but the functions still don't
work (#Name). It works fine if I load the add-in first, then open the
spreadsheet, but this is not agreeable to my users.

Any ideas? Is there a different event that I should use? Or perhaps a
different strategy altogether?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Addin loads but functions don't work

in your beforeclose event, you can change all you formula to text strings.

(pseudocode)
Cells.Replace What:="=", With:="ZZZ="

then save the workbook.

on opening, in the workbook_Open event, load the addin, then convert the
formulas back.

The downside is that this forces a save of the workbook whether the users
want to save or not - so you might include a prompt.

--
Regards,
Tom Ogilvy

"KitenutDave" wrote in message
...
I have a spreadsheet that has a number of calls to functions that are
contained in an add-in. My users start up the spreadsheet by browsing to

the
directory and double-clicking the .xls file. They fill in financial
information, then save the file under a different name. So the original

file
is really just a read-only template. What I want to happen is that

whenever
they open the template file, or any of the modified files, it will check

to
see if the addin is loaded and, if not, load it. For various reasons I

don't
really want the add-in loaded permanently; just when one of these
spreadsheets is opened.

I've tried putting the code in the workbook_open event of the spreadsheet
that seems to load the add-in when necessary, but the functions still

don't
work (#Name). It works fine if I load the add-in first, then open the
spreadsheet, but this is not agreeable to my users.

Any ideas? Is there a different event that I should use? Or perhaps a
different strategy altogether?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Addin loads but functions don't work

Thanks, Tom. Your response gave me an idea. In the workbook_open code, after
loading the add-in, I put a new formula containing a function call in an
empty cell, and it seems to have "refreshed" all the other function calls.
Then I reset the dummy cell to empty.

Don't know why, but it seems to work.
Thanks again.

"Tom Ogilvy" wrote:

in your beforeclose event, you can change all you formula to text strings.

(pseudocode)
Cells.Replace What:="=", With:="ZZZ="

then save the workbook.

on opening, in the workbook_Open event, load the addin, then convert the
formulas back.

The downside is that this forces a save of the workbook whether the users
want to save or not - so you might include a prompt.

--
Regards,
Tom Ogilvy

"KitenutDave" wrote in message
...
I have a spreadsheet that has a number of calls to functions that are
contained in an add-in. My users start up the spreadsheet by browsing to

the
directory and double-clicking the .xls file. They fill in financial
information, then save the file under a different name. So the original

file
is really just a read-only template. What I want to happen is that

whenever
they open the template file, or any of the modified files, it will check

to
see if the addin is loaded and, if not, load it. For various reasons I

don't
really want the add-in loaded permanently; just when one of these
spreadsheets is opened.

I've tried putting the code in the workbook_open event of the spreadsheet
that seems to load the add-in when necessary, but the functions still

don't
work (#Name). It works fine if I load the add-in first, then open the
spreadsheet, but this is not agreeable to my users.

Any ideas? Is there a different event that I should use? Or perhaps a
different strategy altogether?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Addin loads but functions don't work

Well, that causes a recalculate I would think. I assumed you never wanted
to the the #Name errors, but since that isn't the case, then

Application.CalculateFull
after loading the adding

should work in place of what you describe. (assume xl2000 or later)

--
Regards,
Tom Ogilvy

"KitenutDave" wrote in message
...
Thanks, Tom. Your response gave me an idea. In the workbook_open code,

after
loading the add-in, I put a new formula containing a function call in an
empty cell, and it seems to have "refreshed" all the other function calls.
Then I reset the dummy cell to empty.

Don't know why, but it seems to work.
Thanks again.

"Tom Ogilvy" wrote:

in your beforeclose event, you can change all you formula to text

strings.

(pseudocode)
Cells.Replace What:="=", With:="ZZZ="

then save the workbook.

on opening, in the workbook_Open event, load the addin, then convert the
formulas back.

The downside is that this forces a save of the workbook whether the

users
want to save or not - so you might include a prompt.

--
Regards,
Tom Ogilvy

"KitenutDave" wrote in message
...
I have a spreadsheet that has a number of calls to functions that are
contained in an add-in. My users start up the spreadsheet by browsing

to
the
directory and double-clicking the .xls file. They fill in financial
information, then save the file under a different name. So the

original
file
is really just a read-only template. What I want to happen is that

whenever
they open the template file, or any of the modified files, it will

check
to
see if the addin is loaded and, if not, load it. For various reasons I

don't
really want the add-in loaded permanently; just when one of these
spreadsheets is opened.

I've tried putting the code in the workbook_open event of the

spreadsheet
that seems to load the add-in when necessary, but the functions still

don't
work (#Name). It works fine if I load the add-in first, then open the
spreadsheet, but this is not agreeable to my users.

Any ideas? Is there a different event that I should use? Or perhaps a
different strategy altogether?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Addin loads but functions don't work

You're right; CalculateFull works the same as the other code, and is easier,
but I just found an interesting "feature". Both of these solutions work only
if the add-in is in the same directory as the spreadsheet that uses it, which
will not be the case in our production environment. Any thoughts on that one?

"Tom Ogilvy" wrote:

Well, that causes a recalculate I would think. I assumed you never wanted
to the the #Name errors, but since that isn't the case, then

Application.CalculateFull
after loading the adding

should work in place of what you describe. (assume xl2000 or later)

--
Regards,
Tom Ogilvy

"KitenutDave" wrote in message
...
Thanks, Tom. Your response gave me an idea. In the workbook_open code,

after
loading the add-in, I put a new formula containing a function call in an
empty cell, and it seems to have "refreshed" all the other function calls.
Then I reset the dummy cell to empty.

Don't know why, but it seems to work.
Thanks again.

"Tom Ogilvy" wrote:

in your beforeclose event, you can change all you formula to text

strings.

(pseudocode)
Cells.Replace What:="=", With:="ZZZ="

then save the workbook.

on opening, in the workbook_Open event, load the addin, then convert the
formulas back.

The downside is that this forces a save of the workbook whether the

users
want to save or not - so you might include a prompt.

--
Regards,
Tom Ogilvy

"KitenutDave" wrote in message
...
I have a spreadsheet that has a number of calls to functions that are
contained in an add-in. My users start up the spreadsheet by browsing

to
the
directory and double-clicking the .xls file. They fill in financial
information, then save the file under a different name. So the

original
file
is really just a read-only template. What I want to happen is that
whenever
they open the template file, or any of the modified files, it will

check
to
see if the addin is loaded and, if not, load it. For various reasons I
don't
really want the add-in loaded permanently; just when one of these
spreadsheets is opened.

I've tried putting the code in the workbook_open event of the

spreadsheet
that seems to load the add-in when necessary, but the functions still
don't
work (#Name). It works fine if I load the add-in first, then open the
spreadsheet, but this is not agreeable to my users.

Any ideas? Is there a different event that I should use? Or perhaps a
different strategy altogether?









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Addin loads but functions don't work

I'm still having problems with this. In essence, I need to ensure that if a
user opens a spreadsheet by double-clicking on it in Explorer, that it's
requesite addins are loaded and available to the formulas.

As the spreadsheet loads, it seems to check the formulas for "foreign"
references before loading the addin. (The code to load the addin is in the
worksheet_open event). When it doesn't understand the references in the
formulas because the addin isn't there, it pops up the message about the
spreadsheet containing links to another spreadsheet, and do I want to update
the links. All the formulas that reference the addin now have the path to the
spreadsheet's directory appended to them instead of the path to the addin's
directory.

For example, if the original formula was "=CalculateResult(parm1, parm2)",
now the formula would read "=g:\dir1\dir2\Addin.xla!CalculateResult(parm1 ,
parm2)". Ok, except that the directory is wrong - g:\dir1\dir2 is the path to
the spreadsheet, but not the path to the addin.

Am I going about this the right way? Am I making it harder than it needs to
be?

"KitenutDave" wrote:

I have a spreadsheet that has a number of calls to functions that are
contained in an add-in. My users start up the spreadsheet by browsing to the
directory and double-clicking the .xls file. They fill in financial
information, then save the file under a different name. So the original file
is really just a read-only template. What I want to happen is that whenever
they open the template file, or any of the modified files, it will check to
see if the addin is loaded and, if not, load it. For various reasons I don't
really want the add-in loaded permanently; just when one of these
spreadsheets is opened.

I've tried putting the code in the workbook_open event of the spreadsheet
that seems to load the add-in when necessary, but the functions still don't
work (#Name). It works fine if I load the add-in first, then open the
spreadsheet, but this is not agreeable to my users.

Any ideas? Is there a different event that I should use? Or perhaps a
different strategy altogether?

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
Collection custom functions as asn addin FARAZ QURESHI Excel Discussion (Misc queries) 2 December 29th 07 09:17 PM
Custom Functions saved as addin dbutcher Excel Worksheet Functions 2 April 7th 06 05:24 PM
addIn functions in automation nicgendron Excel Programming 1 July 14th 05 10:35 AM
how can i turn functions written in VBA into an addin? avi Excel Programming 1 December 9th 04 03:04 PM
Using Functions from an Excel Addin MWGreen Excel Programming 1 January 22nd 04 09:31 PM


All times are GMT +1. The time now is 11:41 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"