PDA

View Full Version : How to Application.FileDialog(msoFileDialogFolderPicker) for https:// Sharepoint file



Cinema
09-27-2018, 04:54 AM
Hi,

I have a code that should select via Application.FileDialog(msoFileDialogFolderPicker) an Excel File. The files are on Sharepoint. Unfortunately I cannot get an Windows Explorer drive link since Sharepoint has restricted Explorer rights. My folder path (Z:\) that refers to Sharepoint, is generated via "create link" but opens actually an https site.

My code is:

Set foDialog = Application.FileDialog(msoFileDialogFilePicker)
With foDialog
.Title = "Select " + fsFilePathArt + "-File "
.AllowMultiSelect = False
.InitialFileName = "Z:\Input_Data" +"\"
.InitialView = msoFileDialogViewDetails
If .Show = -1 Then
fsFullFileName = .SelectedItems(1)
Else
fsFullFileName = ""
End If
End With


It opens a https site with listed Excel Files in Windows Explorer but does not take the filename after clicking ok.
The folder name is taken by the code

Set foDialog = Application.FileDialog(msoFileDialogFolderPicker)
With foDialog
.Title = "Select a Folder"
.Title = "Select " + fsFilePathArt + "-Folder " '
.AllowMultiSelect = False
.InitialFileName = "Z:\Input_Data" + "\"
If .Show = -1 Then
fsFilePath = .SelectedItems(1)
Else
fsFilePath = ""
End If
End With

So I have no problems to take the foldername but with the file

Paul_Hossler
09-27-2018, 07:49 AM
Suggested something to try in your other post

http://www.vbaexpress.com/forum/showthread.php?63725-Application-FileDialog(msoFileDialogFolderPicker)-with-Network-Folder-Path

Cinema
09-28-2018, 01:16 AM
Thank you for your post. Application.FileDialog(msoFileDialogFolderPicker) works with the code I have posted before. But I have problems with picking the file. How to pick the excel file with objShell??