Button not working, but did yesterday?

drazen

Registered User.
Local time
Today, 14:26
Joined
Jan 28, 2016
Messages
31
I created a button that triggers a website yesterday, it worked fine yesterday, but today nothing happens, this is the code
Code:
Private Sub SE_Click()

Dim ctl2 As CommandButton
Dim UTR2
UTR2 = Replace(Tax_Ref.Value, " ", "") ' Remove spaces

Set ctl2 = Me!SE
    With ctl2
        .HyperlinkAddress = "https://online.hmrc.gov.uk/self-assessment/ind/" & UTR2
    End With
End Sub

It adds a number to the link to go direct to that webpage (via login) I have put a test msgbox on the first line and rem'd out all the other lines, and the msgbox does not show. The button de-presses but nothing happens.

I have a similar button elsewhere and that works fine.

Can anyone Help
 
This seems a very complicated way of achieving this.
Code:
Private Sub SE_Click()

   Dim UTR2 as String

   UTR2 = Replace(Tax_Ref.Value, " ", "") ' Remove spaces

   Application.FollowHyperlink "https://online.hmrc.gov.uk/self-assessment/ind/" & UTR2

End Sub
Unless you have changed the name of the command button by mistake.
 
Thanks for the reply, The code I found online as a copy paste.
I've used your coding now. It still didn't work. I've re-booted my computer and it now works. Strangest thing I've seen in a while.

Thanks for your help :)
 

Users who are viewing this thread

Back
Top Bottom