PDA

View Full Version : Add permanent GUID. to a Template.



GregQik
05-08-2014, 12:15 AM
Would anybody be able to provide some assistance with assigning a user defined GUID to a template.

using code like

'Update the GUID you need below.
strGUID = "{00020905-0000-0000-C000-000000000046}" 'Add the reference
ThisWorkbook.VBProject.References.AddFromGuid _ GUID:=strGUID, Major:=0, Minor:=0

Background:

I am building a common reference library for Multiple MS host applications. The intention is to set the reference to this common reference library by VBA and permanent GUID.
It is already possible to add a reference from a file , but that provides no control over the actual GUID used. It is intended to add a known GUID to newly developed templates to reduce template bloat and template maintenace workload.

The critical part of this process is being able to transport this defined GUID between multiple systems.

Bob Phillips
05-08-2014, 01:46 AM
Not sure what the question is. If you are trying to add a reference to a known GUID, that should be portable, the same on all systems.

GregQik
05-08-2014, 04:58 AM
I want to create a GUID and apply it to a WORD VBA template. The GUID does not yet exist.

The critical part of this process is being able to transport this defined GUID between multiple systems.

fumei
05-08-2014, 01:57 PM
Well creating the GUID is straightforward. However, it is the "applying" it that may be an issue. I am not sure how you would go about doing that. A document property perhaps. I also do not know what you mean by transporting between systems. I suppose that would depend directly on how you find a way to "apply" it.

GregQik
05-12-2014, 04:06 PM
I was trying to avoid generating a different GUID everytime when installing a reference from a file on different computer.

fumei
05-12-2014, 06:03 PM
But if it is a template file, you make the reference by name, not GUID. Or rather, you invoke a template file (I assume you are using it as a code container, a global template) by using it as an add-in, by name. VBA project references are different. I am not quite following.

It is intended to add a known GUID to newly developed templates to reduce template bloat and template maintenace workload.
Please clarify this as I am not seeing how template bloat would be affected. As for maintenance, if you are talking about multiple computers on a network, having a template (as a global) on a server accessed by multiple computers is not a problem.