Function not found OpenXmlPackage.Close

Following through the gmail tutorial and I see the following error:

[Error] Workbook Scope: Method not found: ‘Void DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Close()’.

These are the (latest?) packages:

Running the version I created a few months back it works fine. The packages for that version:

Can this be fixed?

Hi @Nick_Scott,

This looks like a package dependency/version compatibility issue, specifically related to DocumentFormat.OpenXml.

The error:

Method not found: Void DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Close()

usually occurs when one package expects an older version of the OpenXML library, while another package has installed a newer incompatible version.

Since your older project works, I would suggest comparing the package versions between the two projects.

You can try:

  1. Open Manage Packages in the new project.

  2. Compare UiPath.Excel.Activities, UiPath.System.Activities, and other dependencies with the working project.

  3. Try using the same package versions as the working project.

  4. Remove the Excel/Workbook-related package and install it again with a compatible version.

  5. Close Studio and delete the project’s .local or install folder, then reopen and restore the dependencies.

From your screenshots, the newer project is using preview/newer package versions, while the older project has different versions. I would first try matching the package versions from the project that is working.

Also, avoid mixing preview packages with stable packages unless required.

Hope this helps!

@Nick_Scott

Try to create a new project and reproduce the issue.

If it’s reproduced, it’s worth checking if it’s a bug. If it doesn’t reproduce, try deleting the project.json and let it rebuild with dependencies.

yes @ashokkarale, thanks for your response, it is a new project created from scratch. I guess I was looking for confirmation it was bugged.

How can I check if this is a known issue?

Hi,

[Error] Workbook Scope: Method not found: ‘Void DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Close()’.

I think this error is thrown by Autossential.Workbook activities. So, can you try to use UseExcelFile activity in UiPath.Excel.Activites pacakge instead of the above, if you want to just run the tutorial in the academy?

Or it may be a solution to update Autossential.Workbook activities to newer, too.

Regards,

@Nick_Scott

Could you please confirm why you are using the Autossential.Workbook.Activities package.

If not using it, try removing it.

I’m following through the training gmail tutorial, it says to use it - also I don’t have excel so this would be my open hope obiwan-karale

@Nick_Scott

I’m sure the tutorial is talking about the workbook activities which are available in the Excel.Activities package.

These workbook activities don’t require excel installed on your machine.

Here you can find everything about them.

This might be the dependency issue. Check the listed dependencies under your project dependencies and uninstall it- DocumentFormat.OpenXml.

Hi @Nick_Scott,

The fact that the older project works while the newly created project fails is a useful clue. I would first treat this as a package compatibility issue rather than assume the Workbook Scope itself is broken.

The OpenXmlPackage.Close() error means that the code calling OpenXML was compiled against a different version of DocumentFormat.OpenXml than the one being loaded at runtime.

Rather than deleting project.json, I would compare the actual resolved dependency tree between the working and failing projects.

A few things I’d check:

  1. Compare the versions of UiPath.Excel.Activities and any package that brings in DocumentFormat.OpenXml.

  2. Check whether the new project is resolving a newer OpenXML dependency than the working project.

  3. Look for packages marked as preview/STS or otherwise different between the two projects.

  4. Restore the project after changing the dependency versions and test again.

  5. If the issue still reproduces in a completely new project with the current package set, then I’d consider it a package regression/compatibility issue and check the UiPath release notes/support cases for that exact combination.

The method-not-found exception itself is strong evidence of an assembly version mismatch, so I wouldn’t focus on the workflow logic yet.

It uses both I think :slight_smile:

oh and how do I check known bugs?

@loginerror

Could you please help on this?

apologies, this is the wrong thread.

Hi @Nick_Scott

This indeed looks like two incompatible packages (most likely between Autossential and Excel package).

In this case, the one thing to still try is different combinations of the two package versions.

@loginerror are you saying, when I create an automation, I have to go back through package history each time until I find a version that works?

Hey @Nick_Scott

I found a moment to test it out. It should work for this combination:

Autossential.Workbook.Activities 1.4.0 (any ≥ 1.1.0) + UiPath.Excel.Activities 3.6.1

The issue is because of the Autossential.Workbook.Activities │ 1.0.0-preview.22078809 → it’s a preview and it’s compiled against OpenXML 2.x (which is too old).

thanks appreciate the help