I have a big script I just finished that takes data from Portfolio and imports it to Excel, manipulating it and all that jazz to go on our website. The spreadsheet is created fine, but I have to save it in Windows CSV format, which is where things get really tricky.
See, Microsoft Excel somehow doesn’t believe you’ve actually saved a document when you save it as Windows CSV. In fact, without Applescript, if you save a CSV file, and then quit, it will ask you if you want to save changes, as if you actually changed something. Total idiocy.
So, on the applescript side of things, after I save the CSV file with:
set OutFilename to ((outputFolder & ffName & ".csv") as string)
Save ActiveWorkbook In OutFilename As xlCSVWindows without CreateBackup
it creates the CSV file I want, but then when I go to run this command:
close ActiveWorkbook
of course, it asks again if I would like to save the file. This I expected, so I added “saving no” to the end to bypass the redundant save dialog:
close ActiveWorkbook saving no
BUT (and this is the important part), this does NOT tell Excel not to save the file. As a matter of fact, this seems to tell Microsoft to save the file, because Excel then brings up a dialog asking where to save it. Absolute insanity. If you tell it nothing, it asks. But if you tell it no, it thinks yes. If you say saving yes, it does the same thing. How exactly do I tell Excel NOT to save the file AGAIN?
This is v.X on 10.3.9.
Thanks!
–
Steve