Consulting

Results 1 to 3 of 3

Thread: How to Application.FileDialog(msoFileDialogFolderPicker) for https:// Sharepoint file

  1. #1

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

    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

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    Suggested something to try in your other post

    http://www.vbaexpress.com/forum/show...rk-Folder-Path
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    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??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •