Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > it.comp.lang.visual-basic > #20008
| Newsgroups | it.comp.lang.visual-basic |
|---|---|
| Date | 2022-12-02 06:43 -0800 |
| Message-ID | <d8b29811-7c2e-48ce-9f1a-a51b2b66ad19n@googlegroups.com> (permalink) |
| Subject | leggere file txt e popolare celle Excel |
| From | Marco75 <marcoporzi75@gmail.com> |
Ciao,
ho un file txt con 3 informazioni poste su 3 righe.
vorrei leggere questo file e mettere:
- contenuto riga 1 in cella C2
- contenuto riga 2 in cella D2
- contenuto riga 3 in cella E2
ora ho provato così ma non è corretto...
Dim FilePath As String
Dim strFirstLine As String
Dim strSecondLine As String
Dim aFile As String
aFile = "C:\Interventi macina CQ\Ultima ricetta.txt"
If Len(Dir$(aFile)) > 0 Then
FilePath = "C:\Interventi macina CQ\Ultima ricetta.txt"
Open FilePath For Input As #1
Line Input #1, strFirstLine
MsgBox (strFirstLine)
Close #1
Open FilePath For Input As #2
Line Input #2, strFirstLine
MsgBox (strFirstLine)
Close #2
End If
in attesa di cortese risposta continuerò a provare
grazie
Marco
Back to it.comp.lang.visual-basic | Previous | Next — Next in thread | Find similar
leggere file txt e popolare celle Excel Marco75 <marcoporzi75@gmail.com> - 2022-12-02 06:43 -0800 Re: leggere file txt e popolare celle Excel Marco75 <marcoporzi75@gmail.com> - 2022-12-02 07:03 -0800 Re: leggere file txt e popolare celle Excel "Sauro" <vicchi@crsscala.it> - 2022-12-15 17:00 +0100
csiph-web