| 
 | |||||||
| 
 | 
|  | 
|  | 
|  | Strumenti | 
|  08-01-2008, 13:41 | #1 | 
| Junior Member Iscritto dal: Jan 2008 
					Messaggi: 2
				 | 
				
				[Excel] macro-fileDiTesto
			 
		Ciao a tutti, sono nuovo di questo forum, spero di aver azzeccato il topic per inserire questo post!!! Ho un problema nella realizzazione di una macro excel che importi i dati contenuti in un file di testo letto da una dialog box Fino ad ora ho capito che con fileToOpen = Application.GetOpenFilename("Text Files (*.txt), *.txt") apro un file di testo e con With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\testo_prova2.txt", _ Destination:=Range("$T$7")) .Name = "testo_prova2_14" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = 850 .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False importo il file "testo_prova2.txt" in una casella di testo. Il problema è collegare le due azioni: come faccio a dire all'"Add connection" che il file da aprire è quello inserito in "fileToOpen" e non è sempre "testo_prova2.txt"? Grazie a tutti per il tuo aiuto. Ciao | 
|   |   | 
|   | 
| Strumenti | |
| 
 | 
 | 
Tutti gli orari sono GMT +1. Ora sono le: 08:00.









 
		 
		 
		 
		





 
  
 



 
                        
                        










