

Moving from Microsoft Office VBA to AppleScript:
MacTech's Guide to Making the Transition
Introduction
|
Table of Contents
Page Prev and Page Next buttons at bottom of the page.
|
April, 2007
Page 73
.Weight = xlThick
.ColorIndex = 3
End With
End With
To remove all existing borders, run either sequence above, but change the commands in the repeat loop or ModifyBorder handler to just
set line style of thisBorder to line style none
Then follow with
tell application "Microsoft Excel"
tell range "D10" of active sheet
set thisBorder to get border which border edge left
tell thisBorder
set line style to continuous
set weight to border weight thick
set color index to 3
end tell
set thisBorder to get border which border edge right
tell thisBorder
set line style to continuous
set weight to border weight thick
set color index to 3
end tell
end tell
end tell
Since you are making the same three settings to each of the two edge borders, again it would be better practice to use a handler to customize the operation:
tell application "Microsoft Excel"
tell range "D10" of active sheet
set thisBorder to get border which border edge left
my Customize(thisBorder)
set thisBorder to get border which border edge right
my Customize(thisBorder)
end tell
end tell
on Customize(thisBorder)
< Previous Page Next Page>

- SPREAD THE WORD:
- Slashdot
- Digg
- Del.icio.us
- Newsvine