Re: Save lookup data in template (.xlt)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



When you store the code/data in a .xlt, then every workbook that's based on this
template will contain the code/data.

Have you thought of separating your code/data and putting it into an addin.
Then the user could load the addin when they need the macros.

It might make it easier for you if you ever have to update the code or data--who
knows how many workbooks could have created using the .xlt template workbook.

But in either case (.xlt or .xla), you could refer to a worksheet named "Sheet1"
in the workbook that contains the code with something like:

msgbox thisworkbook.worksheets("sheet1").range("b99").value

ThisWorkbook is the workbook that owns the code.

Bill James wrote:
>
> Is it possible to store lookup data in a .xlt template file and access the
> *** from with the VBA code stored in the .xlt file itself?
>
> I created a .xlt template with one work*** and a toolbar with one button.
> This template contains data along with some macros that reference that data.
> Unfortunately, the macro ends with an error when run from a workbook without
> the referenced work***. Is it possible to reference the work***
> contained within the .xlt template?

--

Dave Peterson
.


Quantcast