Hi,
I need help in enabling a text to appear below the mouse when the mouse is hovering on CommandButton1 in the Excel. I tried using the above code in VB 6.5 Editor in Excel. The code didnt do any thing when the mouse is hovering on the CommanButton1. Here is the code. Would you please look into?
--------------------
Private Sub CommandButton1_Click()
Dim stFolder As String
stFolder = "C:\Documents and Settings\a\My Documents\Folder"
If Len(Dir(stFolder, vbDirectory)) <> 0 Then
Shell "Explorer.exe /n,/e," & stFolder, vbNormalFocus
Else
MsgBox "The folder is either removed or renamed!", vbCritical
End If
End Sub
---------------------
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If X < 1 Or X > CommandButton1.Width - 1 Or Y < 1 Or Y > CommandButton1.Height - 1 Then
caption = "Hi" ' change to desired effect
Else
caption = "Hello"
End If
End Sub
------------
I need help in enabling a text to appear below the mouse when the mouse is hovering on CommandButton1 in the Excel. I tried using the above code in VB 6.5 Editor in Excel. The code didnt do any thing when the mouse is hovering on the CommanButton1. Here is the code. Would you please look into?
--------------------
Private Sub CommandButton1_Click()
Dim stFolder As String
stFolder = "C:\Documents and Settings\a\My Documents\Folder"
If Len(Dir(stFolder, vbDirectory)) <> 0 Then
Shell "Explorer.exe /n,/e," & stFolder, vbNormalFocus
Else
MsgBox "The folder is either removed or renamed!", vbCritical
End If
End Sub
---------------------
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If X < 1 Or X > CommandButton1.Width - 1 Or Y < 1 Or Y > CommandButton1.Height - 1 Then
caption = "Hi" ' change to desired effect
Else
caption = "Hello"
End If
End Sub
------------