Browse our Products

Aspose.Tasks for Python via .NET 25.6 Release Notes

All Changes

KeySummaryIssue Type
TASKSNET-11497Add and ability to add new VBA module to the project with existing VBA modulesNew Feature
TASKSNET-710Implement updating of VBA source code for the existing VBA modules in MPP fileNew Feature
TASKSNET-11496Add VbaModuleType to public APIEnhancement
TASKSNET-11484Fix VBA Forms, Project and ClassModule are not included in VbaProject.ModulesEnhancement
TASKSNET-3422Add rendering of “Title Horizontal” and “Title Vertical” gridlines of Gantt chartEnhancement

Public API and Backwards Incompatible Changes

The following public types were added:Description
aspose.tasks.VbaModuleTypeSpecifies the type of a module in a VBA project.
The following public methods and properties were added:Description
aspose.tasks.saving.MPPSaveOptions.write_vbaGets or sets a value indicating whether to update existing VBA macros data in MPP file.
aspose.tasks.VbaModule.typeGets the type of the module.
aspose.tasks.VbaModule.create_procedural_module(string)Creates an instance of with VbaModuleType.ProceduralModule type.
aspose.tasks.VbaModule.create_class_module(string)Creates an instance of with VbaModuleType.ClassModule type.
aspose.tasks.VbaModuleCollection.to_listConverts the collection object to a list of objects.
The following public enumerations were added:Description
aspose.tasks.VbaModuleType.DOCUMENT_MODULEA type of VBA project item that specifies a module for embedded macros and programmatic access operations that are associated with a document.
aspose.tasks.VbaModuleType.PROCEDURAL_MODULEA module containing collection of subroutines and functions.
aspose.tasks.VbaModuleType.CLASS_MODULEA module that contains the definition for a new object. Each instance of a class creates a new object, and procedures that are defined in the module become properties and methods of the object.
aspose.tasks.VbaModuleType.DESIGNER_MODULEA module that extends the methods and properties of an ActiveX control that has been registered with the project.

Examples and additional notes

Related issue: TASKSNET-710 - Implement updating of VBA source code for the existing VBA modules in MPP file.

Starting with version 25.6 source code of the existing VBA modules can be updated:

import aspose.tasks as tsk

project = tsk.Project("ProjectWithVba.mpp");
vba_module = project.vba_project.modules[0]
vba_module.source_code = """Sub Method()
MsgBox ""This is an updated text.""
End Sub"""

opts = tsk.saving.MPPSaveOptions()
opts.write_vba = True
project.save("output.mpp", opts)

Related issue: TASKSNET-11497 - Add and ability to add new VBA module to the project with existing VBA modules.

Starting with version 25.6 new module (Class or Procedural) can be added to MPP file with the existing VBA project (project should contain VBA modules):

import aspose.tasks as tsk

project = tsk.Project("ProjectWithVba.mpp");

new_module = tsk.VbaModule.create_procedural_module("Procedural")
new_module.source_code = """Sub TestMacro()
MsgBox ""This is a test macro.""
End Sub"""
project.vba_project.modules.append(new_module)

opts = tsk.saving.MPPSaveOptions()
opts.write_vba = True
project.save("output.mpp", opts)