VBAProject.References

How do I add a reference to the VBAProject? I found an example for PowerPoint (Slides), but not for Excel (Cells). I’ve attached an image of the references I need my spreadsheet to have.

Hi,

Thanks for your posting and considering Aspose.Cells.

Your issue/requirements are not clear enough. Could you please explain it in more detail and provide some more screenshots. Also please let us know how you are achieving PowerPoint (Slides) example for this purpose.

Please remember Aspose.Cells is a .NET assembly so it is mostly used in C# and VB.NET project. Do you have a VB.NET project? Please explain.


Here's the link to your article on how to do it in Slides:
http://www.aspose.com/docs/display/slidesnet/Adding+VBA+Macros+in+Presentation

What I'd really like your product to do is for it to add the references required for the files (.bas, .cls, .frm) that I have added automatically because the files contain the required references and when I use the Excel object model, it DOES do that for me automatically.

Hi,

Thanks for your posting and using Aspose.Cells.

It seems to be a new feature and currently not available in Aspose.Cells. We have therefore added a request in our database for product team consideration and development of this feature. We will look into it and implement it if possible. Once there is some fix or other news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43925 - Add VBA Macros in Workbook

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.6.0.2 and let us know your feedback.

Please try the new fix with code like:

C#
Workbook workbook = new Workbook();

VbaProject vp = workbook.VbaProject;

vp.References.AddRegisteredReference(“stdole”, *\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\system32\stdole2.tlb#OLE Automation");

workbook.Save(“res.xlsm”);

The issues you have found earlier (filed as CELLSNET-43925) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.