Issue while ussing WorkBook.Save method in Invoke method

studio

#1

Hi all,
Could anyone please help me as i am facing issue while using the save method of excel workbook in Invoke Method where i am giving Save as method name and TargetObject ExcelFileName.CurrentworkBook. i am getting the following error

"wORKBOOK DOES NOT HAVE A PUBLIC INSTANCE METHOD NAMED SAVE MATCHING THE PARAMETER TYPES, GENERIC TYPE ARGUMENTS AND GENERIC TYPE CONSTRAINTS SUPPLIED TO INVOKE METHOD ".

Please help me with this


#2

Hello,

On target object of your invoke method you can try passing this instead.

CType(ExcelWorkbookScope.CurrentWorkbook, Microsoft.Office.Interop.Excel._Workbook)

Note that most of the UiPath Activity such as write cell/range will save your workbook once they will append it so that call might not be effectively required…

Cheers.


#3

@Florent_Salendres Could you breif it i am not able to understand it


#4

image

No validation error if you use

CType(ExcelFileName.CurrentWorkbook, Microsoft.Office.Interop.Excel._Workbook)

Cheers


#5

@Florent_Salendres still facing the issue


#6

@adrian @vvaidya @badita could you plesae help me with this


#7

This error might be either related with your “imports” as you see under or another Custom activity package/older UiPath version you are using.

image

My recommendation is that you start to reproduce the part you were making in a New Workflow, from my side using last UiPath version it works fine.

You also have the option to use Invoke Code passing your ExcelWorkbookApplication object as argument and use the .save from there.

Good luck