View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jozef[_2_] Jozef[_2_] is offline
external usenet poster
 
Posts: 1
Default Macro attached to button runs twice


My macro runs normally if I run it from VBA editor. If I attache it t
excel buton it runs twice. Does enybody know why ?
(My macro is stored in .xla)

Sub My_Hyperlink1(Directory As String)
Dim My_Adress As String
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = Directory
.Show
My_Adress = .SelectedItems(1)
End With
ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell, Address:=My_Adress
End Sub
Sub test_My_Hyperlink1()
My_Hyperlink1 "C:\"
End Su

--
Joze
-----------------------------------------------------------------------
Jozef's Profile: http://www.excelforum.com/member.php...fo&userid=1602
View this thread: http://www.excelforum.com/showthread.php?threadid=27525