Looking to perform the following actions on a open excel doc-
- Delete Column C
- Save as a UTF-16 text file
They are very simple docs, 4 columns, one sheet.
I have previously posted about this, and got 2 great responses to my attempts that for some reasons aren’t working anymore. I have Both Office 2008 and 2011, so I can use which ever works.
Here are the scripts that I used- (its been a while)
Delete Column C
tell application "Microsoft Excel"
set myBook to get workbook "Workbook1.xls"
set mySheet to get worksheet "Sheet1" of myBook
set myRange to get range "C:C" of mySheet
delete range myRange
end tell
Save as text (this one never saved as UTF-16, just as text)
tell application "Microsoft Excel"
activate
try
set uiFilePath to get save as filename file filter "TEXT" filter index 1
on error
--Cancel pressed
return false
end try
try
save workbook as active workbook filename uiFilePath file format text Mac file format
return true
on error
return false
end try
end tell
Thanks for looking, seems simple, but I can’t make it work.
Matt