Não consegui executar o codigo abaixo. ocorreu o erro que diz "Não é possivel importar o este arquivo", na linha (DoCmd.TransferText acImportDelim, ";", "NovaTabela", txtFilePath)
Private Sub teubotao_Click()
Call BrowsingWindow
End Sub
'habilite a referencia VBA Microsoft Office xx.x Object Library
Sub BrowsingWindow()
Dim Dlg As FileDialog
Dim txtFilePath As String
Dim varFile As Variant
Set Dlg = Application.FileDialog(msoFileDialogFilePicker)
With Dlg
.Title = "Select the file you want to import"
.AllowMultiSelect = False
If .Show = True Then
For Each varFile In .SelectedItems
txtFilePath = varFile
Next
DoCmd.TransferText acImportDelim, ";", "NovaTabela", txtFilePath
Else
Exit Sub
End If
End With
End Sub
Private Sub teubotao_Click()
Call BrowsingWindow
End Sub
'habilite a referencia VBA Microsoft Office xx.x Object Library
Sub BrowsingWindow()
Dim Dlg As FileDialog
Dim txtFilePath As String
Dim varFile As Variant
Set Dlg = Application.FileDialog(msoFileDialogFilePicker)
With Dlg
.Title = "Select the file you want to import"
.AllowMultiSelect = False
If .Show = True Then
For Each varFile In .SelectedItems
txtFilePath = varFile
Next
DoCmd.TransferText acImportDelim, ";", "NovaTabela", txtFilePath
Else
Exit Sub
End If
End With
End Sub