I encountered error when i try to read the file in the folder (excel file), it seems like it creates a ~ at the front of the file and does not allow to read it.
do you know why? it says either it is corrupted or i do not have permission to use the file. But i am able to open the file from folder. Any help is great appreciated!
first copy the file path which is in currentfile.tostring
and check it manually whether the file getting opened or having any password so that you will get an idea
use run command or press windows+r
or
check the value of the cuurentfile.tostring by using logmessage above excel process scope
how the value you are getting
Thank you @Yoichi san! it works well! I have another question. If i wish to read excel into a data table to put into 5th columns onwards, what is the best solution? I tried adding columns before read, but encountered below which i believe it was becoz i added those columns:
if i add the columns after reading, then it will appear on the right side of the data table. I need the first 4 columns to be on the left side.
Dear @Yoichi san,
Thank you for always supporting!! Now it manages to read range, however, when i try to update 1 of the cell, error encounered “No row at position 1”.
And when i open the datatable, i also noticed the columns seems not correct as below.
If you want to add column and move it to the first position, the following will work.
First, add DataColumn using AddDataColumn activity
Next, call dt.Columns(“columnname”).SetOrdinal(0) using InvokeMethod activity as the following image.