title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Wednesday, April 20, 2011 | |
So if you want to automate Excel 2008 with Applescript, you have to minimize your tells. There are some strange scoping interferences. For instance, this code breaks. tell application "Microsoft Excel"Try to compile/run and you get "Syntax Error -- Can't get "E" in "ABCDEFG". Access not allowed." Wack. Fun times with text manipulation and Excel automation, eh? So code that borks like that needs to be pulled out of the tell block. You maintain values that were pulled out of Excel references, so it's not a big deal other than the inherent wackiness. So in my code now, the tell block to Excel is very small. -- it seems like you could do all this work within telltheValue sticks around afterwards and my stock/simple string manipulation calls work again, so no problems. Not sure if doing the tell inside of instead of outside of my logic's loops causes some big bridge between Excel and Applescript to be built, destroyed, and built again, but it's already so freakin' slow it's not like it really matters. There's fast as in "give it to me now" and 'fast' as in "give it to me in a few hours after I go for a run, to the grocery store, and do the dishes". This is in the second, and is nearly already in the "go to sleep on it and hope it's done in the morning" category that comes afterwards. I hate this. (I ran into this "sleep on it" speed at a shop that used Crystal Reports against very large databases and it drove me MAD. It was bad enough I took the time to figure out a way to have Crystal use SQL directly against the DB, moving the logic where it's supposed to go -- the database -- and left Crystal just with formatting. Thank heavens. Even if I personally only used it a few times, give me a break, folk. We went from clients waiting all night -- even DAYS at times -- for reports to them waiting a few minutes at worst. It's not 1980 any more! Your workstations are fast if you're not gaming, okay? (Not 1980, that is, unless you're using Applescript to automate Excel 2008, apparently.)) FUN IN KLUDGEVILLE!!! I'll probably repost my "practical example" as it is now in a bit. It's not clean at all. Drives me a little crazy. Labels: applescript, code, excel, problem solved posted by ruffin at 4/20/2011 02:00:00 PM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|