-
Notifications
You must be signed in to change notification settings - Fork 46
VBAToolKit feature : Recreate Configuration
VBAToolKit is able to recreate the Excel file corresponding to a configuration.
A configuration is described by a name, a path, and a number of modules.
When asked to recreate a configuration, VBAToolKit creates an Excel file :
-
containing all the modules described in the configuration
-
whose
VBProject
object has the name of the configuration. -
whose name is the same than in the indicated path
-
whose file type is consistent with the extension indicated in the path (for example, a
.xlam
configuration will be recreated as an Excel add-in)
The recreation of configurations is accessible via a form that can be viewed by clicking the according button in the VBAToolKit ToolBar .
It is possible to create either a single configuration, either every configuration except the one selected. This is handy when we don't want to recreate the DEV configuration we are working on.
It is impossible to recreate a configuration corresponding to an open Excel workbook.
-
Firstly, VBAToolKit gets the list of projects and their respective location information from the "remembered projects" file, described here. The module dedicated to this purpose is
vtkProjects
. -
Then, it uses this information to compute the location the XML description file that describes the wanted project.
-
VBAToolKit then creates a dedicated
vtkConfigurationManager
object to read from the file and get the project information. -
The
vtkRecreateConfiguration
function uses the information found in the XML file and the modules found at the paths indicated in the XML file.
The vtkRecreateConfiguration
function creates a Workbook
object, fills it with the relevant data (modules, project title, etc), and saves it at the indicated path, with the relevant fileformat.
The filetypes corresponding to the extensions are :
xlsx -> xlOpenXMLWorkbook
xltx -> xlOpenXMLTemplate
xltm -> xlOpenXMLTemplateMacroEnabled
xlsm -> xlOpenXMLWorkbookMacroEnabled
xlam -> xlOpenXMLAddIn
xla -> xlAddIn
xls -> xlExcel8
-
A green path indicates a valid path.
- for a folder or a template, it indicates that the object exists in the file system.
- for an XML file, it indicates that the file exists ad is loadable without problems, that is to say : is compliant with the embedded DTD.
-
A red path indicates that the object does not exist in the file system.
-
An orange path is only used for XML files : it indicates that the file could be found but could not be loaded : there is a problem, probably with the DTD. In the near future, a button to diagnose the problem could be put near the text field.
-
The
Create Configuration
button will only be enabled if :- a project is selected
- a configuration is selected
- the template (if any) needed for creating the configuration can be found.