Neuigkeiten:

Ist euer Problem gelöst, dann bitte den Knopf "Thema gelöst" drücken!

Mobiles Hauptmenü

Bitte um Hilfe bei FileDialog

Begonnen von datekk, Mai 11, 2016, 15:42:15

⏪ vorheriges - nächstes ⏩

datekk

Hi,

ich möchte einen FileDialog in meiner Datenbank nutzen. Die Beispiele, welche ich finde, laufen aber alle nicht. Hier das aktuellste:


Private Sub cmdFileDialog_Click()
 
   ' Requires reference to Microsoft Office 11.0 Object Library.

    Dim fDialog As Object
    Set fDialog = CreateObject("Office.FileDialog")
   Dim varFile As Variant
 
   With fDialog

      ' Allow user to make multiple selections in dialog box
      .AllowMultiSelect = True
             
      ' Set the title of the dialog box.
      .Title = "Please select one or more files"

      ' Clear out the current filters, and add our own.
      .Filters.Clear
      .Filters.Add "Access Databases", "*.MDB"
      .Filters.Add "Access Projects", "*.ADP"
      .Filters.Add "All Files", "*.*"

      ' Show the dialog box. If the .Show method returns True, the
      ' user picked at least one file. If the .Show method returns
      ' False, the user clicked Cancel.
      If .Show = True Then

         'Loop through each file selected and add it to our list box.
         For Each varFile In .SelectedItems
            'Me.FileList.AddItem varFile
         Next

      Else
         MsgBox "You clicked Cancel in the file dialog box."
      End If
   End With
End Sub


Ausführung bricht wie folgt ab: "Laufzeitfehler 429. Objekterstellung durch Objekt X Komponente nicht möglich."

Folgende Verweise hab ich gesetzt:

- Visual Basic for Application
- Microsoft Access 16.0 Object Library
- OLE Automation
- Microsoft Office 16.0 Access Database engine Object
- Microsoft Outlook 16.0 Object Library
- Microsoft Office 16.0 Object Library

Fragezeichen Fragezeichen Fragezeichen. Bitte um Hilfe. Nutze Office 2016.
Access 2016 mit SQL Server Backend. Bereits umgesetzt: Access mit MS SQL Backend,  ADODB Formularbindung, Streamen von Dateien zum SQL Server und zurück (Filestream), Drag&Drop Dateiupload zum Server, CTI / TAPI Integrierung in Access Anwendung - Nutzung auch über Remote Desktop, selbst aktualisierendes Access Frontend auf entfernten Rechnern (Upgrade). Berichte / Kreuztabellen mit SQL Server Backend, Mail Tagging, Outlook Steuerung über Access und umgekehrt // Grundwissen in .Net Core & Blazor Apps

DF6GL

Hallo,


etwa so :

Dim fDialog As Office.Filedialog, varFile As Variant

   Set fDialog = Application.Filedialog(msoFileDialogFilePicker)
   With fDialog
      .AllowMultiSelect = True
      .Title = "Please select one or more files"
 
.
.
.

datekk

Access 2016 mit SQL Server Backend. Bereits umgesetzt: Access mit MS SQL Backend,  ADODB Formularbindung, Streamen von Dateien zum SQL Server und zurück (Filestream), Drag&Drop Dateiupload zum Server, CTI / TAPI Integrierung in Access Anwendung - Nutzung auch über Remote Desktop, selbst aktualisierendes Access Frontend auf entfernten Rechnern (Upgrade). Berichte / Kreuztabellen mit SQL Server Backend, Mail Tagging, Outlook Steuerung über Access und umgekehrt // Grundwissen in .Net Core & Blazor Apps