leyeti77
New Member
- Joined
- Jan 22, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- 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.
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