I have two documents: A list of file names in a csv, and an excel Template that contains conditional formatting. I’d like to open the template amd save it to another folder with the name of each file name in the csv. This script seems to be working right up until saving the file. Any thoughts?
tell application “Finder”
set theFolder to choose folder with prompt "Choose your ouput folder"
set the theTemplate to choose file with prompt "Choose the template"
set theSource to choose file with prompt "Choose your reference list"
tell application "Microsoft Excel"
activate
open theSource
tell worksheet theSource
set myData to value of used range
set myList to items of myData
set theCount to count of items of myList
repeat with i from -1 to theCount
open theTemplate
tell document theTemplate
activate
set TheName to i as string
set destinationPath to theFolder & TheName
save active workbook in destinationPath
end tell
end repeat
end tell
end tell
end tell