Browse our Products

Aspose.Tasks for Java 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
com.aspose.tasks.VbaModuleTypeSpecifies the type of a module in a VBA project.
The following public methods and properties were added:Description
com.aspose.tasks.MPPSaveOptions.getWriteVbaGets a value indicating whether to update existing VBA macros data in MPP file.
com.aspose.tasks.MPPSaveOptions.setWriteVba(boolean)Sets a value indicating whether to update existing VBA macros data in MPP file.
com.aspose.tasks.VbaModule.getType()Gets the type of the module.
com.aspose.tasks.VbaModule.CreateProceduralModule(String)Creates an instance of with VbaModuleType.ProceduralModule type.
com.aspose.tasks.VbaModule.CreateClassModule(String)Creates an instance of with VbaModuleType.ClassModule type.
com.aspose.tasks.VbaModuleCollection.get(int)Gets the module at the specified index.
com.aspose.tasks.VbaModuleCollection.get(String)Gets the module with the specified name.
com.aspose.tasks.VbaModuleCollection.size()Gets the count of modules
com.aspose.tasks.VbaModuleCollection.isReadOnly()Returns whether collection is read-only
com.aspose.tasks.VbaModuleCollection.iterator()Returns the enumerator to iterate over modules
com.aspose.tasks.VbaModuleCollection.addItem(VbaModule)Adds new module to the collection
com.aspose.tasks.VbaModuleCollection.clearRemoves all newly added modules
com.aspose.tasks.VbaModuleCollection.contains(VbaModule)Returns whether the collection contains specified module
com.aspose.tasks.VbaModuleCollection.remove(VbaModule)Removes specified module from the collection
com.aspose.tasks.VbaModuleCollection.toList()Converts the collection object to a list of objects.
The following public enumerations were added:Description
com.aspose.tasks.VbaModuleType.DocumentModuleA type of VBA project item that specifies a module for embedded macros and programmatic access operations that are associated with a document.
com.aspose.tasks.VbaModuleType.ProceduralModuleA module containing collection of subroutines and functions.
com.aspose.tasks.VbaModuleType.ClassModuleA 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.
com.aspose.tasks.VbaModuleType.DesignerModuleA 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:

Project project = new Project("FileWithVbaProject.mpp");

if (p.VbaProject.Modules.Count == 0)
{
    throw new InvalidOperationException("Project should contain VBA modules");
}

var existingModule = project.VbaProject.Modules["Module1"];
existingModule.SourceCode = @"Sub Method()
MsgBox ""This is an updated text.""
End Sub";
           
// WriteVba flag should be specified in order to apply changes to MPP file.
project.Save("output.mpp", new MPPSaveOptions { WriteVba = true });

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):


Project project = new Project("FileWithVbaProject.mpp");

if (p.VbaProject.Modules.Count == 0)
{
    throw new InvalidOperationException("Project should contain VBA modules");
}

VbaModule newModule = VbaModule.CreateProceduralModule("TestModule10");
newModule.SourceCode = @"Sub TestMacro()
MsgBox ""This is a test macro.""
End Sub";

project.VbaProject.Modules.Add(newModule);
            
// WriteVba flag should be specified in order to apply changes to MPP file.
project.Save("output.mpp", new MPPSaveOptions { WriteVba = true });