Browse our Products

Aspose.Tasks for .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.WriteVbaGets 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.CreateProceduralModule(System.String)Creates an instance of with VbaModuleType.ProceduralModule type.
Aspose.Tasks.VbaModule.CreateClassModule(System.String)Creates an instance of with VbaModuleType.ClassModule type.
Aspose.Tasks.VbaModuleCollection.Item(System.Int32)Gets the module at the specified index.
Aspose.Tasks.VbaModuleCollection.Item(System.String)Gets the module with the specified name.
Aspose.Tasks.VbaModuleCollection.Count
Aspose.Tasks.VbaModuleCollection.IsReadOnly
Aspose.Tasks.VbaModuleCollection.GetEnumerator
Aspose.Tasks.VbaModuleCollection.Add(Aspose.Tasks.VbaModule)
Aspose.Tasks.VbaModuleCollection.Clear
Aspose.Tasks.VbaModuleCollection.Contains(Aspose.Tasks.VbaModule)
Aspose.Tasks.VbaModuleCollection.CopyTo(Aspose.Tasks.VbaModule[],System.Int32)
Aspose.Tasks.VbaModuleCollection.Remove(Aspose.Tasks.VbaModule)
Aspose.Tasks.VbaModuleCollection.ToListConverts the collection object to a list of objects.
The following public enumerations were added:Description
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.
Aspose.Tasks.VbaModuleType.ProceduralModuleA module containing collection of subroutines and functions.
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.
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 });