XL2003 working with an XLA and two separate workbooks

K

Keith

I'm rewriting a project to keep code common to a bunch of XLS files in one
common XLA on a network (much easier to update). The XLA needs to be
accessible to multiple users, and I need to create new user files on the
fly. I'll diagram my workflow below, but the question of the moment is if I
open the XLA from workbookA, then open workbookB and close workbookA; will
closing the workbookA automatically close the XLA since that is where the
VBA called it, or will it stay accessible to Excel until it is unloaded (or
Excel is closed?). If I try to load the XLA in workbookB when it is already
loaded from workbookA, will that cause problems?
Thanks,
Keith

(indented lines show real code, primary lines are just to show the logic to
save some space instead of including all the code, since my basic question
is conceptual)

Shortcut to Master_wkbk on all user desktops
Open Master_wkbk
Master_wkbk loads XLA
Set RnRXLA = Workbooks.Open(RnRPath & WorkingFiles & RnRXLAName, False,
False)
Does User_wkbk exist? If no, create and open
fFileExists = (Len(Dir(RnRPath & LanID & ".xls")) > 0)
Set RnRUserWkbk = Workbooks.Open(RnRPath & LanID & ".xls", False,
False)
Within the individual workbook, check to make sure the XLA is present
(individual workbook code)
Windows(RnRXLAName).Activate 'can an xla be activated? Is there a
better way to check if XLA is loaded?
If Err <> 0 Then 'file wasn't found
Err = 0 'reset err code
Set RnRXLA = Workbooks.Open(RnRPath & WorkingFiles & RnRXLAName,
False, False)
Else
'do nothing, the XLA is already open
End If
Close the master workbook, now that the individual workbook is created and
open (within the master workbook code)
this is the point I'm not sure what happens to the XLA if it was called from
the master workbook
Me.Close savechanges:=False

And finally, when I'm closing the individual workbook, should I close the
XLA?

Thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top