April 25, 2017
OK, from Mynda's webinars, I know how to open a file on a local drive using the
Application.GetOpenFileName method.
And from Google searches, I see how to navigate to a SharePoint folder and select a file via this code.
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "https://"Specific SharePoint Path" & "\"
.Show
End With
But the part I don't get, and what I'm trying to do is allow a user to open the file they select and then perform manipulations on it e.g. copy cells from that SharePoint file onto my local file where I'm running the macro from.
I was hoping that after executing the above code and selecting a file, that I could invoke the GetOpenFileName method and grab the file. But when I do just that, I end up selecting my desired Excel file (but then it doesn't do anything further with that file). Next, Excel executes the GetOpenFileName method but just opens up to a local folder on my hard drive and NOT the SharePoint folder. Does anyone know how to bring it all together to allow a user to open their file of interest in a SharePoint folder that is pre-specified for them?
Many thanks.
Trusted Members
October 17, 2018
Trusted Members
Moderators
November 1, 2018
GetOpenFilename doesn't open workbooks. It appears that all you need is to amend the original code to something like this:
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "https://"Specific SharePoint Path" & "\"
If .Show = -1 then .Execute
End With
Answers Post
1 Guest(s)