I want to send the contents of a dictionary to Excel. I was wondering if there is a quick way of converting a dictionary to a datable so that I can then use write range, or should I just loop through the dictionary and write the dictionary key and data into the Excel worksheet line by line.
Thanks very much @Divyashreem and @aksh1yadav. I just looped through the dictionary and wrote directly into the excel using write cell (rather than convert to datatable first). I was hoping that there was some kind of instant conversion function like Cint (for example turning a string into an integer) that could be applied to a dictionary to turn it into a datatable then to excel via write range.(just being lazy!)
As you say @aksh1yadav making sure that you are using the correct argument type in the for each loop is essential and good job adding an example its very helpful.