• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Excel insanity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excel insanity


  • Subject: Re: Excel insanity
  • From: Yvan KOENIG via AppleScript-Users <email@hidden>
  • Date: Fri, 27 Mar 2020 18:59:35 +0100

As I don't own the app I can't compile and test.

I'm wondering if it's the block designed to warn that the address is available
which fools Excel.
As there is no reason to break the flow if the address is available,
try to move it so it would be displayed only if the address is unavailable.

Maybe Excel is really bothered by a call to an OSAX in a tell application block.

If I made no typo this would be achieved by:
tell application "Microsoft Excel"
        tell workbook "Update Email List.xlsx"
                tell worksheet "TIM Emails"
                        set searchRange to range ("C2:C9999")
                        try
                                set foundRange to find searchRange what
theEmailAddress
                                -- this way the dialog is not triggered if the
address is available -- ADDED
                        on error errMsg number errNbr -- ADDED
                                -- If the email address is not present an error
will display the dialog -- MOVED/Edited
                                tell me -- MOVED
                                        activate -- MOVED
                                        display dialog "Email address <" &
theEmailAddress & "> isn't available in file" giving up after 3 -- MOVED
                                end tell -- MOVED
                                return -- MOVED
                        end try
                        -- Find first blank row
                        set blank to ""
                        set searchRange to range ("C2:C9999")
                        set foundRange to find searchRange what blank
                        set theRow to (first row index of foundRange) as text
                        tell foundRange -- ADDED
                                set value of cell ("A" & theRow) to FirstName
                                set value of cell ("B" & theRow) to LastName
                                set value of cell ("C" & theRow) to
theEmailAddress
                                set value of cell ("D" & theRow) to DateString
                                set value of cell ("E" & theRow) to "Email"
                        end tell -- ADDED
                end tell
        end tell
end tell

Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi
27 mars 2020  18:58:39


 _______________________________________________
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

References: 
 >Excel insanity (From: David Crowe via AppleScript-Users <email@hidden>)
 >Re: Excel insanity (From: Yvan KOENIG via AppleScript-Users <email@hidden>)

  • Prev by Date: Re: Excel insanity
  • Previous by thread: Re: Excel insanity
  • Next by thread: Re: Excel insanity
  • Index(es):
    • Date
    • Thread