Argument 'Workbook': BC30512: Option Strict On disallows implicit conversions from 'String' to 'IWorkbookQuickHandle'. The selected value is incompatible with the property type

Hi all,

I’m trying to convert a excel file (.xlsm) to save as and overwrite an .xlsm in another folder. When I’m using the “Save Excel File As” function, I get this error when trying to have to save the value to the new folder. I’m not sure where this error is coming from. Thank you in advance

“Argument ‘Workbook’: BC30512: Option Strict On disallows implicit conversions from ‘String’ to ‘IWorkbookQuickHandle’. The selected value is incompatible with the property type.”

Hi @jinson.buri

Could you try like below

  1. use excel file activity and provide excel variable FacCompRecent. This will generate excel workbook variable

  2. then inside it, use save excel file as and specify workbook variable created in step 1 under workbook instead of FacCompRecent.fullname

Hi thank you for the help. I believed I saved the workbook into the correctvarilable for FACompRecent. Unfortunately, I’m getting another error that states “Argument ‘WorkbookPath’: BC30456: ‘LastModifiedDate’ is not a member of ‘FileInfo’.”

Not sure how its not a member, I need to use lastmodifieddate to grab the latest updated excel file in the folder selected. Thank you

@jinson.buri,

To get last modified date, use this code

IO.File.GetLastWriteTime(yourFilePath)
1 Like

Hi @jinson.buri

As per your workflow, I see you are already selecting the last modified files from your folder, so why do you feel the need to do it again while providing workbook variable?

Correct, I took off the “Last Modified” and now I get a different message. The error is now listed as the following.

Argument ‘WorkbookPath’: BC30451: ‘FACompRecent’ is not declared. It may be inaccessible due to its protection level. Variable ‘WorkbookPath’ is missing. Please use Data Manager to recreate it.

@jinson.buri

I believe, under use excel file, it should be like FacCompRecent.FullName and not just FacCompRecent

Also, check to ensure you are using use excel file inside your for each as scope of variable FacCompRecent is inside that only.

@jinson.buri

Please see below, I am able to save excel file under different name following below.

Hi Sonali,

Thank you for the guidance. I entered “.fullname” and I still get the same message. I’m not sure where its stemming from.

@jinson.buri

Can you delete that workbook path from use excel file and then click on plus and then select that FAC variable from there instead of typing it in?

You don’t put .fullname on FACompRecent.

Hi! Yes, I was able to re-do the workflow following the appropriate steps and it was able to run it. Thank you

1 Like

Hi @jinson.buri

Glad to hear that :slight_smile:

Now that your issue is resolved, kindly mark the post that helped as a solution.

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