Re: Excel save with overwrite currently not supported
Re: Excel save with overwrite currently not supported
- Subject: Re: Excel save with overwrite currently not supported
- From: Shane Stanley via AppleScript-Users <email@hidden>
- Date: Wed, 28 Aug 2019 10:17:51 +1000
On 28 Aug 2019, at 3:36 am, Thomas Maffucci via AppleScript-Users
<email@hidden> wrote:
>
> Still Get Save Alert Message
Excel has an application property called "display alerts", which according to
the dictionary: "Returns or sets if Microsoft Excel displays certain alerts and
messages while handling events from AppleScript." So turn that off:
set sd to path to startup disk
tell application id "com.microsoft.Excel" -- Microsoft Excel
try
close sd -- will error
end try
end tell
set thePath to (path to desktop as text) & "Excel document.xlsx"
tell application id "com.microsoft.Excel" -- Microsoft Excel
set display alerts to false
activate
make new workbook
tell active sheet
set value of range "A1" to 10
end tell
save workbook as active workbook filename thePath
close active workbook saving no
-- now save over it
make new workbook
tell active sheet
set value of range "A1" to 5
end tell
save workbook as active workbook filename thePath
close active workbook saving no
end tell
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden