Notifications
Clear all

Expor caminho do diretório e nome do arquivo.

2 Posts
2 Usuários
0 Reactions
934 Visualizações
(@bellizzi)
Posts: 0
New Member
Topic starter
 

Amigos, bom dia.

Estou com uma dúvida, gostaria de saber se tenho como inserir em uma célula o caminho do diretório e o nome do arquivo que estou utilizando como conexão para trabalhar dados.
Este arquivo que serve como conexão é um txt e não fica aberto.

 
Postado : 10/03/2015 8:24 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Bom dia!!

Já tentou assim?

Sub AleVBA_14939()
MyPath = Range("A1").Value
If Right(MyPath, 1) <> "" Then
    MyPath = MyPath & ""
End If
FilesInPath = Dir(MyPath & "*.xl*")
If FilesInPath = "" Then
    MsgBox "Arquivo não encontrado"
    Exit Sub
End If
End Sub

Att

 
Postado : 10/03/2015 8:44 am