Okay I am stumped on this one and after trying for well over an hour my google skills are failing me. I am trying to make a range of cells no longer have strikethrough formatting. I can set other cell formating values like bold but strikethrough is what I need to fix.
Doesn’t work
tell application "Microsoft Excel"
tell active sheet
set range1 to range "B3:B11"
set font style of font object of range1 to "Bold"
--set font style of font object of range1 to set strikethrough to false
get font style
set strikethrough to false
end tell
end tell
Strikethrough dosn’t work
--http://forum.keyboardmaestro.com/t/ms-excel-apply-formatting/1552/3
tell application "Microsoft Excel"
tell worksheet "Daily Priorities" of active workbook
set range1 to range "B3:B11"
tell range1
set bold to false
set font size to 12
get font style
set strikethrough to false
--get underline
--set font style to "underline"
set font style to "Bold"
--get color
set color to {255, 0, 0}
set name to "Times New Roman"
(*
set {name, font style, font size, strikethrough, superscript, subscript, ¬
outline font, shadow, font color index} to {"Arial Narrow", "Italic", ¬
10, false, false, false, false, false, color index automatic}
*)
end tell
end tell
end tell
You are awesome, that works like a charm, thanks a bunch!
tell application "Microsoft Excel"
--tell active sheet
tell worksheet "Daily Priorities" of active workbook
set range1 to range "B3:B11"
set font style of font object of range1 to "Bold"
set bold of font object of range1 to false
--set font style of font object of range1 to "Strikethrough" --Oddly the same logic doesn't apply to strikethrough, instead do
set strikethrough of font object of range1 to true
set strikethrough of font object of range1 to false
end tell
end tell
For what it’s worth that helped me figure how to do it in the style of the first AppleScript for anyone searching for this in the future (it just might end up being me again).
--http://forum.keyboardmaestro.com/t/ms-excel-apply-formatting/1552/3
tell application "Microsoft Excel"
--tell active sheet
tell worksheet "Daily Priorities" of active workbook
set range1 to range "B3:B11"
tell range1
set value to "New Words In This Cell"
set cellStyle to font object
tell cellStyle
set bold to false
set font size to 12
--get font style
set strikethrough to true
--get underline
--set font style to "underline"
set font style to "Bold"
--get color
set color to {255, 0, 0}
set name to "Times New Roman"
(*
set {name, font style, font size, strikethrough, superscript, subscript, ¬
outline font, shadow, font color index} to {"Arial Narrow", "Italic", ¬
10, false, false, false, false, false, color index automatic}
*)
end tell
end tell -- cellStyle
end tell -- range1
end tell