Copy from xlsx to xlsm

Hello everyone,
I’m trying to copy data from an xlsx to an xlsm, my read range works and I use append range workbook to copy to the xlsm.
But I get this error: Append Range Workbook: Value does not fall within the expected range or not matches found, any ideas?
Thanks

Hi @Maxime_LAUGIER

What does PathExcelAPINI variable contains. Please specify.

Regards

Hello,

it’s the Path of the XLSM file

Thanks

@Maxime_LAUGIER,

Bot is expecting same headers at destination worksheet and it’s not getting it.

Thanks,
Ashok :slight_smile:

Hi @Maxime_LAUGIER

The data in the xlsx and xlsm files are not in the same structure, I can say no Column count of the two files are not matched.

When you are using append range workbook activity the count of columns in the two files has to be matched orelse it will throw the above exception.

Hope you understand!!

Hello @ashokkarale ,

Thank you for your answer,

As you can see, the read range from the initial file xlsx is from I2:AG50.

I paste this range from example A200 to Z200

My main issue is, if I copy the xlsm sheet to a new empty file with the same datas, run the script, everything work fine.

Do you think, because the xlsm file is a huge file with a lot of macros, something could be weird ?

Hello,

The columns names are the same

Hello everyone,

Any ideas?

Thanks

Hello Everyone,

I am really stuck with this, i can share all files if necessary.

Thank you in advance

Maxime

Hello everyone,

i found a tricky solution for this, instead of using Apppend range WorkBook, you have to :
With a Excel Process scope, Use excel file and read range, save it to a DataBase
→ Kill Excel Process
Open a excel process scope, use excel file and then, use write DataTable to Excel and use your previsous DT to paste.
You have to select in this activity => type Append & Exlude Headers if necessary

I really hope it will help others.

Thank you everyone for your time

Maxime

1 Like

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