T
Tobias Weber
Hi,
my aim is to open WikiLinks from Excel X cells.
I have a working solution using AppleScript, FastScripts and perl, but
it breaks down when the selection is discontinuous, probably because of
a bug in (this version of) Excel or its dictionary:
set theTexts to {}
tell application "Microsoft Excel"
set theRange to Selection
set theSize to count Cells of theRange
repeat with cellNumber from 1 to theSize
set theCell to Cell cellNumber of theRange
set end of theTexts to theCell's text
end repeat
end tell
So I turned to VBA, and indeed the following works with discontinuous
selections:
BASE = "http://127.0.0.1:8000/"
For Each Cell In Selection
ActiveWorkbook.FollowHyperlink Address:=BASE & Cell.Value,
NewWindow:=True
Next
However I get an error when replacing the ip with "localhost". Why? How
to make it work?
Anyway, I'd rather call a unix programm (perl script) instead of opening
the URL with Excel, since I need more logic and have no desire
whatsoever to write that in VBA.
I did get the "Shell" function to work with command line arguments (for
passing the cell content) on Windows but keep getting strange errors on
the Mac. Can someone point me to an example?
my aim is to open WikiLinks from Excel X cells.
I have a working solution using AppleScript, FastScripts and perl, but
it breaks down when the selection is discontinuous, probably because of
a bug in (this version of) Excel or its dictionary:
set theTexts to {}
tell application "Microsoft Excel"
set theRange to Selection
set theSize to count Cells of theRange
repeat with cellNumber from 1 to theSize
set theCell to Cell cellNumber of theRange
set end of theTexts to theCell's text
end repeat
end tell
So I turned to VBA, and indeed the following works with discontinuous
selections:
BASE = "http://127.0.0.1:8000/"
For Each Cell In Selection
ActiveWorkbook.FollowHyperlink Address:=BASE & Cell.Value,
NewWindow:=True
Next
However I get an error when replacing the ip with "localhost". Why? How
to make it work?
Anyway, I'd rather call a unix programm (perl script) instead of opening
the URL with Excel, since I need more logic and have no desire
whatsoever to write that in VBA.
I did get the "Shell" function to work with command line arguments (for
passing the cell content) on Windows but keep getting strange errors on
the Mac. Can someone point me to an example?