Close Workbook VB expression

I am building a bot (my first bot) and it opens an excel workbook, refreshes it with a macro and saves it. At the end I added close workbook to close the workbook and I am getting an error. The close workbook activity says it closes an opened excel workbook. If I put nothing in close workbook it says “value for a required activity argument ‘workbook’ was not supplied”. I can get rid of that error by adding a variable however if I enter the variable under the Excel Application Scope under properties Existing Workbook. I get an error on Excel Application Scope that says “Only one overload group should have its arguments configured”. I am trying to understand how Close Workbook and Excel Application Scope are connected. Because if I fixe one of the errors I get the other error.
*Close workbook is in the do of the excel application scope.

Why can’t you try after all your Excel scope activity use attache window and use close window activity…

1 Like

There is an Output property on the Excel Scope. Try putting the Workbook variable there. Then, use that same variable in the Close Workbook. That should work, and it’s how I do it.

2 Likes

This worked! Thank you so much!

1 Like

please mark that as solution and close the topic.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.