Using GetObject to edit other workbooks works 1 time out of x
<p>First, I am a begginer. Any advice is welcome ! Just trying to code at work to save time later managing 100s of files. </p>

<p>I am building an Excel macro and, just as many other users, I am trying to do the following :</p>

<ul>
<li>Have the macro "reside" in a workbook "A".</li>
<li>Trigger the macro using keyboard shortcut from a workbook "B" </li>
<li>Have the macro do its magic in workbook "B" (which includes copying a sheet from a workbook "C")</li>
</ul>

<p>This involves, at some point, prompting the user for workbook "C", defining a variable and putting workbook C in it.</p>

<p>The following code is a part of the macro and works only one time out of x and apparently "crashes" without warning or error code or even letting me know it has crashed.</p>

<pre><code>'All the following code is in workbook "A"

Dim fd As FileDialog
Dim ffs As FileDialogFilters
Dim DestWkb As Workbook
Dim SourceWkb As Workbook
Dim SourceWkbPath As String

'Set active workbook as destination workbook (this is workbook "B")
Set DestWkb = ActiveWorkbook

'Prompt user for source workbook (this will be workbook "C")
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
    Set ffs = .Filters
    With ffs
        .Clear
        .Add "Excel", "*.xlsx"
    End With
    .AllowMultiSelect = False
    If .Show = False Then Exit Sub
    SourceWkbPath = fd.SelectedItems(1)
End With

'Here is where it starts to go wrong..
'This message box will show up with correct data in it :

MsgBox SourceWkbPath

'This line seems to work, as I can see in VB the workbook specified by the user
Set SourceWkb = GetObject(SourceWkbPath)

'From here... it's like there was an Exit Sub. I will rarely see the following msgbox : 

MsgBox "Success"
</code></pre>

<p>Anybody already faced such a trouble ? Thank you very much!</p>