You are reading a single comment by @dst2 and its replies. Click here to read the full conversation.
  • I would like to open the open file dialogue using VBA from a pre specified location on a sharepoint site. I can open the open dialogue bow using GetOpenFilename. How can I make sure the open dialogue box is always pointing at the correct place?

    For bonus points, can I also filter files based on the filename (with wild card)? i.e. the file name structure will be filename_yyymmdd. I'd like the user to only see files with the filename string in them.

    and sorted by date for even more ageing fixeh sidder points.

    https://msdn.microsoft.com/en-us/vba/excel-vba/articles/application-getopenfilename-method-excel

  • This will get you close

    Sub OpenFile()
    Dim myfile As String
    
    With Application.FileDialog(msoFileDialogFilePicker)
        .InitialFileName = "C:\TEMP\filename*"
         .Show
        myfile = .SelectedItems(1)
        End With
    
    Workbooks.Open Filename:=myfile
    
    End Sub
    

    (Obviously replace c:\temp with your directory). Have a google of msoFileDialogFilePicker for some of the other variables

    Although if you really don't want them to select other files I'd be tempted to use VBA to create a sheet with a list of the files that they can open hyperlinked to the location.

  • sorted by date

    I reckon you would struggle to do this with .net or vb, let alone VBA.

    A diiiirty way could be to have a VBA application caller insert a dword value into the registry to force the sort order, and then remove it when the sub is run. The walk away when your PC stops running.

About

Avatar for dst2 @dst2 started