VBA FollowHyperlink : Excel file do not open until Break or Stop instruction ?

leyeti77

New Member
Joined
Jan 22, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello team,
First, I have spend literally a two complete days over the last 7 days, to search for a solution, made many attempts, and really feel weird about this simple act 'Open another file' which seems now very complex (to me at least).
I need to open an Excel file located on a SharePoint. Whatever the solution (Workbook.Open, or FollowHyperLink) it does not open, unless I'm in step by step mode, or add a Stop just after the instruction
I have also tried to use a Call to another Sub, (That is the reason the "Call" instruction is present below) but it was exactly the same issue.
Any brilliant suggestion is welcome, as this macro will be used by non expert and this should be transparent to them.

VBA Code:
    ActiveWorkbook.FollowHyperlink (Range("Focus_File_Adress").Value)
    'Call Open_Focus_File
    Stop ' With this Stop, the file opens after 10 sec which is the normal duration

looping:  ' Before using the "STOP" instruction, I had set the below line to wait until the file eventually opens
       Application.Wait (Now + TimeValue("00:00:01"))
      Set oFocus_Wb = GetWorkbook(sFocus_Name)
       oPBar.Pos 1, "Wait for file to Open " & " Loop : " & i
       ' Interruption demandee
            If oPBar.StopRequested Then GoSub Break_Requested
            i = i + 1
            If oFocus_Wb Is Nothing Then GoTo looping
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the MrExcel forum.

Try:
VBA Code:
  DoEvents
  ActiveWorkbook.FollowHyperlink (Range("Focus_File_Adress").Value)
  DoEvents


Or this:
VBA Code:
  DoEvents
  Call Open_Focus_File
  DoEvents

----- --
Let me know the result a
Dante Amor
----- --
 
Upvote 0
Hi,
Tried both, and unfortunately, "Duck still alive" as we say in France. Sorry for that, Thx for the attempt
Why do we need to Stop the macro (on be in Step mode) in order the file opens ? I do not catch the mechanism here.
 
Upvote 0

Forum statistics

Threads
1,224,881
Messages
6,181,536
Members
453,054
Latest member
ezzat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top