hi friends, can someone show me how to get file names from a folder using a while loop and write it into my existing excel sheet into a column without creating a new data column. I don’t want to use for each loop because my bot works well with while loop.
Hi @Shazid_Rahman,
Please, take a look at the attached file
Main.xaml (6.8 KB)
Result:
If it solves your problem, kindly mark this post as solution to close this topic.
If you need extra help, please let me know
Thanks!
hi @Shazid_Rahman,
Kindly refer the solution provided by @gustavo.cervelin, and mark it is as solution if it solves your purpose, so that the thread can be closed.
Thanks
thankyou
My pleasure @Shazid_Rahman
Just don’t forget to mark the answer that helped you the most as solution to close this topic
Thanks!
Don’t use a While loop. Just use Directory.GetFiles and it’ll put the list of files into an array.
Then For Each through the Array and add each filename as a row in a datatable. Then use Write (or Append) Range to write to Excel.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.