How to use Close Workbook?

excel

#1

Hi,

Someone please help How to use Close Workbook?

I am opening excel using Excel Application Scope and assigning some variable in Output and while using Close Workbook activity I am giving the same variable name in Target property. But still I am getting an error. Also I am using the close workbook activity within the scope of Excel Application Scope activity.


#2

Hi @cthamizh,
The problem is exactly this, you can’t use the Close Workbook activity right inside the Excel Application Scope .


複数のシートを個々にファイル作成する。:Create multiple files individually
#3

Hi @acaciomelo, Yeah, It’s working :slight_smile:


#4

I am exactly using the same though I am getting error that particular value cannot be converted into UiPath.Excel.WorkbookApplication.


#5

Close Workbook activity: how to properly use it

I understand this issue has already been sort of mentioned/addressed however I am wondering how to relate to this compiling error: "Value of type ‘UiPath.Core.Window’ cannot be converted to ‘UiPath.Excel.WorkbookApplication’

the first type is the variable defined for the attached window when using Excel Application scope

I have used the same variable in the ‘Close workbook activity’ outside the scope, and thats when i get the compiling error.

So what am I missing


#6

@William_Adomako,

Just hit Ctl+k in the Excel Application scope output property and name the variable.

Just change the scope of the variable to global(parent container) from the variable pane.


#7

image

sorry I used a start process activity to open the file not an excel application scope, my apologies for the mix up.
after the start process activity then i used an attach window to house all the activities which is ok.

it is the output variable of the attached window
that I am trying to use as target for the close workbook activity.


#8

I don’t get it why you wanna do it with attach window and then coming back to workbook activity :stuck_out_tongue: there is a mismatch of variable.
However if you want to use attach window then use “Close window” activity which do accept “UiPath.Core.Window” as windows variable .
Close workbook works if your opening file in Excel Application scope activity


#9

thnx for ur feedback, I appreciate it, I do understand the mismatch as you have mentioned. I will follow ur advise as stated