Update VBA - Changes are not saved

Hi Aspose team,

first great news that we cannot manipulate VBA in Word documents.
One isse - I am making changes of VBA modules source code and when I open changed document after it is saved I still see original source code in VBA project.

Please check attached VS project. Just compile it, run it and check document NEW_VBA.docm.

WordUpdateVBA.zip (129.2 KB)

Thanks,
Oliver

@dr_oli

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19187. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Aspose team,

any news here?
I understand first come first served concept but this was big bells announcement for Aspose.Words 19.9 and it does not work.

Thx,
Oliver

@dr_oli

Could you please use the latest version of Aspose.Words for .NET 19.9 with the following code example and share your findings? We have not faced the shared issue while using Aspose.Words for .NET 19.9.

String OldCode = "";
String NewCode = "";

Console.WriteLine("1. (Word)" + DateTime.Now.ToString());
Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "VBA.docm");

Console.WriteLine("2. Reading VBA Project" + DateTime.Now.ToString());
VbaProject project = doc.VbaProject;

Console.WriteLine("3. Looping and changing VBA Modules" + DateTime.Now.ToString());
foreach (Aspose.Words.VbaModule module in project.Modules)
{
    OldCode = module.SourceCode;
    NewCode = OldCode.Replace("Oliver", "Aspose");
    module.SourceCode = NewCode;
}

Console.WriteLine("4. Saving changed document" + DateTime.Now.ToString());
doc.Save(MyDir + "19.9.docm");


doc = new Aspose.Words.Document(MyDir + "19.9.docm");
project = doc.VbaProject;

foreach (Aspose.Words.VbaModule module in project.Modules)
{
    Console.WriteLine(module.SourceCode);
}

Hi Tahir,

problem is that when you read VBA with your code it will report that modules now have Aspose and not Oliver like in original file but please open newly created document and there you will see that source is still with oliver.

I attached screenshot for your reference:

Clipboard01.jpg (61.0 KB)

Thanks,
Oliver

Btw. my test was with 19.9

@dr_oli

Thanks for your feedback. Currently, this issue is under analysis phase. Once we complete the analysis of this issue, we will then provide you the ETA of this issue. Thanks for your patience.

Any chance to have this fixed in 19.10? Still this was key extension in previous release but it does not work :frowning:

@droli

We have planned this issue for October 2019 release. Please note that this ETA is not final at the moment. However, we will inform you via this forum thread once this issue is resolved. Thanks for your patience.

Hi,

I see Aspose.Words 19.10 just released but without fix for not saved changed VBA. Can you please check with colleagues to have this for next release?

Thx

@droli,

Unfortunately, this issue (WORDSNET-19187) is not resolved yet. We have completed the analysis of this issue and the fix of this issue is currently being developed. We will inform you via this thread as soon as this issue will be resolved in future or any estimates maybe available. We apologize for any inconvenience.

@droli,

Regarding WORDSNET-19187, we have good news for you i.e. the fix of this issue will be included in the next version of Aspose.Words. If everything goes by plan, we are very hopeful to integrate the fix in the 19.11 version of Aspose.Words. We will inform you via this thread as soon as the next version containing the fix of your issue will be released at the start of next month.

Thanks for update.
If you have some 19.10.x version which I can already test feel free to share it with me :slight_smile:

@droli

Unfortunately, there is no 19.10.x version of Aspose.Words available. Please wait for October 2019 release. We will inform you via this forum thread once it is released.

The issues you have found earlier (filed as WORDSNET-19187) have been fixed in this Aspose.Words for .NET 19.11 update and this Aspose.Words for Java 19.11 update.