Below is a pic of what I'm trying to update. The old version had a extra couple of tabs that were unnecessary so I got rid of them and tried to fix the code so that it would actually run. Well, it looks like I got most of it done (pretty good I think as I've never done this before).
Anyway, the first tab works. If I select a file and click on open, the file opens up correctly. That's not the case with the second tab though. It does pick up the names and links for the tab but when I actually run the macro and try to select a link the macro does not find the requested file.
Hopefully someone will notice what's wrong below. This is only part of the code. Figured it should be enough as it looks like its the part that works with the links etc. I'm thinking it's the "bTime = True" that is throwing it off but I'm not sure how to fix it. Before, it was at the part of the last tab section (4 tabs originally). I tried putting it after "Range("QA_Name").Select" but that didn't work.
Private Sub cmdOK_Click()
Dim iIndex As Integer, sLink As String, bTime As Boolean
On Error GoTo er
bTime = False
Workbooks("Links.xls").Activate
If sTab = "Templates / Macros" Then
iIndex = lTEM.ListIndex
Range("TEM_Name").Select
Range(Selection, Selection.End(xlDown)).Select
bTime = True
ElseIf sTab = "Q & A" Then
iIndex = lQA.ListIndex
Range("QA_Name").Select
End If
sLink = ActiveCell.Offset(iIndex, 1).Value
ActiveWorkbook.FollowHyperlink Address:=sLink, NewWindow:=True
Unload Me
If bTime = True Then
MsgBox "Please Remember to Log into TimeSharing!", , "Links"
End If
Exit Sub
er:
MsgBox "Link was not Located", vbExclamation, "Factset Links"
End Sub
Bookmarks