Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Launch an excel hyperlink programatically without clicking

In C6, I have the following: =HYPERLINK(D5,"Folder on PC").
In D5, I have =PCPath.
PCPath is a rangename that refers to somewhere on my PC depending on
the value of another cell.

My question: Can I make a macro that launches this hyperlink without
having to pick up the mouse (e.g. ctrl-A)?
Thanks,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Launch an excel hyperlink programatically without clicking

Range("C5").Select
and then simulate a mouse click. See:

http://scriptorium.serve-it.nl/view.php?sid=44
--
Gary's Student
gsnu200710


" wrote:

In C6, I have the following: =HYPERLINK(D5,"Folder on PC").
In D5, I have =PCPath.
PCPath is a rangename that refers to somewhere on my PC depending on
the value of another cell.

My question: Can I make a macro that launches this hyperlink without
having to pick up the mouse (e.g. ctrl-A)?
Thanks,


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Launch an excel hyperlink programatically without clicking

The macro breaks in between these two lines:
Public Const SW_SHOW = 5

Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd
As Long) As Long

and gives the following message in a pop up visual basic window:
"Compile Error: Only comments may appear after End Sub, End function,
or End Property."

Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Launch an excel hyperlink programatically without clicking

These statements need to go at the top of the module, in the Declarations
section.
Also, depending on the type of code module, you may have to make them
Private.

NickHK

wrote in message
oups.com...
The macro breaks in between these two lines:
Public Const SW_SHOW = 5

Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd
As Long) As Long

and gives the following message in a pop up visual basic window:
"Compile Error: Only comments may appear after End Sub, End function,
or End Property."

Any ideas?




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
Eliminate second browse box when right clicking for hyperlink Dirter Scott Excel Worksheet Functions 0 November 1st 06 03:38 AM
Information about activecell before clicking on hyperlink Mats Nilsson Excel Programming 7 August 15th 06 08:13 PM
Launch new browser window from hyperlink within Excel Hal Anderson Excel Worksheet Functions 0 December 1st 05 11:17 PM
Programatically Creating a Hyperlink Using VB.Net ? eBob.com Excel Programming 1 December 4th 04 03:42 AM
Creating a hyperlink in a excel cell programatically sameershenoy Excel Programming 0 May 12th 04 06:12 AM


All times are GMT +1. The time now is 12:04 PM.

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

About Us

"It's about Microsoft Excel"