Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the code below to make a msgbox:
Answer = MsgBox("Do you wish to open part one ?", _ vbOKCancel, "My Title") If Answer = vbCancel Then Exit Sub If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= _ "Q:\path is here\baook1.xls" _ , NewWindow:=False, AddHistory:=True Sheets("Mar_04").Select Range("A1").Select But it isnt working and I have no idea how to fix this problem. An helpmwould be greatly appreciated. : -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm note quite sure, but I think you have to write the End If statement every time: If Answer = vbCancel Then Exit Sub End If If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= [...] End If The better version for this would be: If Answer = vbCancel Then Exit Sub Else ActiveWorkbook.FollowHyperlink Address:= [...] End If Regards, Thomas |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fraggs,
It would help if you told us what isn't working. I tested it and it worked for me. How did you declare Answer, it should not be a string or range? Post back more details. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Fraggs " wrote in message ... I'm using the code below to make a msgbox: Answer = MsgBox("Do you wish to open part one ?", _ vbOKCancel, "My Title") If Answer = vbCancel Then Exit Sub If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= _ "Q:\path is here\baook1.xls" _ , NewWindow:=False, AddHistory:=True Sheets("Mar_04").Select Range("A1").Select But it isnt working and I have no idea how to fix this problem. Any helpmwould be greatly appreciated. :) --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Fraggs
Mimicking your code I had the same problem. Looking in the Excel VBA help file I noticed the following in the FollowHyperlink Method: AddHistory Optional Variant. Not used. Reserved for future use. I got rid of the AddHistory parameter and everthing was fine. Do likewise and yours should work too If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= _ "Q:\path is here\baook1.xls" _ , NewWindow:=False Regards Paul "Fraggs " wrote in message ... I'm using the code below to make a msgbox: Answer = MsgBox("Do you wish to open part one ?", _ vbOKCancel, "My Title") If Answer = vbCancel Then Exit Sub If Answer = vbOK Then ActiveWorkbook.FollowHyperlink Address:= _ "Q:\path is here\baook1.xls" _ , NewWindow:=False, AddHistory:=True Sheets("Mar_04").Select Range("A1").Select But it isnt working and I have no idea how to fix this problem. Any helpmwould be greatly appreciated. :) --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLOOKUP displaying "NO ANSWER" instead of "0" | Excel Worksheet Functions | |||
How do I write an excel formula with a text answer ("yes" or "no") | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
disregard 12/19/05 ".XValues syntax problem" question. Answer fou | Charts and Charting in Excel |