As per Eduard, this is how we were able to use %Activate with Excel.

1. Go to the Activate wizard and look for the Excel object. In our case it was Microsoft Excel 16.0 object library. This will create the appropriate package/classes.

2. In our case, the functionality we needed was the Save As function of Excel. Through the Microsoft documentation and also trial and error:

Set SourceFile="location of file"

Set DestFile="location of file"

Set App=##class(Activate.Excel.Application).%New() //this will create an Excel application object

Set Workbooks=App.Workbooks.Open(SourceFile) //bring that Excel file into memory

Set XLSXFormat=51 //the format that we need, found some docs //here:  https://www.rondebruin.nl/win/s5/win001.htm

DO Workbooks.SaveAs(DestFile,XLSXFormat)

DO Workbooks.Close()

Understanding the structure of this package now, it looks like we can explore more with other features/functions of Excel.

No, we are not trying to consume data from Excel. We created an Excel file with one of our routines. It is a nicely formatted Excel file in Excel XML format. We have a group that is requesting that we send that data over in XLSX format. We have figured out a way to use Excel COM operations through Powershell to get this to work. We would like to figure out how to do this in Cache using the Activate classes. There's not that much documentation out there on how to do this.

Hello Evgeny, yes we use those methods in that link already for exporting and importing roles.

What's happening is that the resources / tables that were in the destination server that should not be there anymore is still there. It looks like it is only copying what we exported from the source server. It is not making the role the same.

We figured out how to remove the resources using the Security.Roles.Modify() method by setting the Properties("Resources") parameter. But how would we do something similar to the tables which should not be there anymore in the destination server?

Hello Mike, yes we have figured out how to implement unit testing in Cache. It's an excellent way to test all cases. But for the type of current work we are doing (reporting), it might be too much work. Once you get the hang of it, it's a pretty simple process. It's up to you to cover all of the test cases.

If you need help, you can just post your question here. There are a lot of Cache experts in this community that can help.