Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Function BestandOpzoeken(Optional Pad As String) As String
Dim dlgPicker As FileDialog
Dim sType() As String, sFile As String
Dim tmp As String, sPad As String
Dim bCheck As Boolean
Dim varItem As Variant
On Error GoTo Hell
If Pad = "" Then sPad = CreateObject("WScript.Shell").SpecialFolders("MyDocuments") Else: sPad = Pad
If Right(sPad, 1) <> "\" Then sPad = sPad & "\"
Set dlgPicker = Application.FileDialog(msoFileDialogFilePicker)
With dlgPicker
.Title = "Selecteer een bestand." 'De titel voor het venster
.InitialFileName = sPad
With .Filters
.Clear
.Add "Microsoft Excel", "*.xls; *.xlsx; *.xlsm", 1 'Beperk de bestandstypes tot .xls
End With
.FilterIndex = 1
.AllowMultiSelect = True 'Slechts één bestand kiezen toegestaan
.InitialView = msoFileDialogViewList 'Bepaal weergave
If .Show = -1 Then 'Bepaal of gebruiker op OK-knop heeft geklikt.
For Each varItem In .SelectedItems
If Not sFile = vbNullString Then sFile = sFile & "|"
sFile = sFile & varItem 'String wordt gevuld met geselecteerde bestand
Next varItem
Else
MsgBox "Er is op <Annuleren> gedrukt..."
BestandOpzoeken = "Annuleren"
GoTo Hell
End If
End With
BestandOpzoeken = sFile
Hell:
Set dlgPicker = Nothing
End Function
Private Sub Command152_Click()
Dim sFiles As Variant
Dim i As Integer
sFiles = Split(BestandOpzoeken("K:\Group\accounts\bp shell\bp\bp import map\") , "|")
If LBound(sFiles) = UBound(sFiles) Then Exit Sub
For i = LBound(sFiles) To UBound(sFiles)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Brandstofrapport BP", sFiles(i), True
Next i
End Sub
Private Sub Command0_Click()
Dim sFiles As Variant
Dim i As Integer
sFiles = BestandOpzoeken("K:\Group\ACCOUNTS\ICS Mastercard")
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Importtabel", sFiles, True
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.