Skip to main content

IDEAScript Questions

Import XLS file, add the filename and resave

Someone at the IDEA site posted a question in which they wanted to import several excel files, add the filename to the file and then resave the excel spreadsheet.

I came up with this script which will hopefully help them up.  It first asks for the folder in which the excel files are stored, it then imports all the excel files, in this case each file had a worksheet called school risks, so anyone using this script would have to modify the worksheet name and the new field name.

Option Explicit

Sub Main
&nbsp