Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Emulate RightClick on Hyperlink in Macro
 
Posts: n/a
Default How do I emulate rightclick on a hyperlink in an Excel Macro

What I am trying to do

Write a Macro in an Excel Workbook which will enable me to:

1. Go to a web site from a hyperlink within an Excel Worksheet.
2. Identify and copy a required hyperlink which is within that web site.
3. Return to the Excel Worksheet.
4. Paste the displayed text of the copied hyperlink as text to display in
the cell containing the hyperlink which led to the web site.
5. Move down one cell to the next hyperlink in the Excel Worksheet.

Then repeat steps 1 to 5 above (Say 2500 times in a simple loop).

Manual Keystroke Sequence

Left Click on the Hyperlink.
Highlight and copy the link required in the web site visited.
Return to the Excel Workbook.
Right Click on the active cell.
Select Edit HyperLink.
Alt+t.
Ctrl+V.
Enter.
Delete Underlining.
Bold.
Move down one cell.

Macro to do the Manual Keystroke Sequence

ActiveCell.Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 15
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

Emulate RightClick on the ActiveCell on this Line
SendKeys "%I"
SendKeys "%I"
SendKeys "%T"
SendKeys "^V"
SendKeys "ENTER"

Selection.Font.Underline = xlUnderlineStyleNone
Selection.Font.Bold = True
ActiveCell.Offset(1, 0).Select

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 4.0 macro remover tool Sachin Shah Excel Discussion (Misc queries) 0 August 25th 05 04:14 AM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Display form from an VB application in Excel kuhni Excel Discussion (Misc queries) 0 August 10th 05 06:04 PM
Macro excel save mrbalaje Excel Discussion (Misc queries) 1 May 12th 05 06:27 PM
Hyperlink to specific sheet in Excel Web File jd17 Links and Linking in Excel 0 December 8th 04 09:03 PM


All times are GMT +1. The time now is 10:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"