Creating an invoice from excel without the grid. How?

Hi,

I’m creating an invoice from excel but I can’t get the information without the grid. I tried invoke VBA but I always get an exception that the VBA isn’t safe.
I did choose the trust VBA from settings but no help.
I also took of the grid off from excel sheet manually but it still appeared to the invoice :expressionless:
Is there any suggestions?
Also is it possible to print a picture from excel? Now the invoice doesn’t show it.

Hi @Hanne

Can you try the below

or

Cheers!!

Sadly even your example is not working as I get the suggestion to allow the VBA, I did but nothing changed.
I have trying to find answers but none of the advices worked so far.

Let’s keep this alive few more days as I haven’t found an answer.

Hi @Hanne
Create a VBA macro in your Excel file.

You can do this by following these steps:

  • Press Alt + F11 to open the Visual Basic for Applications (VBA) editor.
  • In the Project Explorer window, find your workbook and double-click it to open its code window.
  • Paste the following VBA code into the code window:

Sub HideGridlines()

ActiveWindow.DisplayGridlines = False

End Sub

  • Close the VBA editor.
  • Save your Excel file with the macro-enabled format (.xlsm).

In UiPath Studio, create a new sequence.

Drag and drop an “Excel Application Scope” activity into the sequence.

In the properties of the “Excel Application Scope” activity, specify the file path of your Excel file.

Drag and drop an “Execute Macro” activity inside the “Excel Application Scope”.

In the properties of the “Execute Macro” activity, set the following:

  • MacroName: Enter the name of the macro you created (e.g., “HideGridlines”).
  • WorkbookPath: Specify the file path of your Excel file.

Thank you. Now it’s works at least in my test project!

Is it possible to use this with read range/read cell which I have used before? I tried but the grid did still show in my other project even though I saw the excel file didn’t have it anymore.

1 Like

@Hanne

If the above steps helped you then please mark it as solution.

Using the “Read Cell” or “Read Range” activities in UiPath, we can read data from Excel cells or ranges, but you cannot directly remove the Excel gridlines with these activities. These activities are designed to retrieve data from Excel rather than manipulate its appearance.

Yes, I’m just wondering why the read cell/range activities are retrieving also the grid if I have used the hide gridlines earlier to the same excel file. Is there anyway to stop this happening?

@Hanne

When you use the “Read Cell” or “Read Range” activities in UiPath to retrieve data from an Excel file, they retrieve the data from the cells regardless of whether the gridlines are hidden or not. The gridlines in Excel are simply a visual representation and do not affect the underlying data.

If you’re seeing the gridlines being retrieved along with the data, it’s likely because the gridlines are still visible in the Excel file itself, even if they are hidden in the UI. This could be due to various reasons, such as the Excel file having a default setting to display gridlines, or specific cells having gridlines applied to them directly.