Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
How is the best way to show in msgbox contain some file e.g. text file? Regards Mark |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If it's a small amount of text, just read it in and plop it into your msgbox.
Here's a link that may help: http://support.microsoft.com/support...eio/fileio.asp Alternatively, if there's lots of stuff, you may want to just invoke NotePad. Dim myFileName As String myFileName = "C:\my documents\excel\test.txt" If Dir(myFileName) = "" Then 'do nothing Else Shell "start notepad " & myFileName End If Mark wrote: Hi, How is the best way to show in msgbox contain some file e.g. text file? Regards Mark -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That link doesn't work anymore.
-- Regards, Tom Ogilvy "Dave Peterson" wrote in message ... If it's a small amount of text, just read it in and plop it into your msgbox. Here's a link that may help: http://support.microsoft.com/support...eio/fileio.asp Alternatively, if there's lots of stuff, you may want to just invoke NotePad. Dim myFileName As String myFileName = "C:\my documents\excel\test.txt" If Dir(myFileName) = "" Then 'do nothing Else Shell "start notepad " & myFileName End If Mark wrote: Hi, How is the best way to show in msgbox contain some file e.g. text file? Regards Mark -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm.
Do you know of a replacement link? (I couldn't find one.) Tom Ogilvy wrote: That link doesn't work anymore. -- Regards, Tom Ogilvy "Dave Peterson" wrote in message ... If it's a small amount of text, just read it in and plop it into your msgbox. Here's a link that may help: http://support.microsoft.com/support...eio/fileio.asp Alternatively, if there's lots of stuff, you may want to just invoke NotePad. Dim myFileName As String myFileName = "C:\my documents\excel\test.txt" If Dir(myFileName) = "" Then 'do nothing Else Shell "start notepad " & myFileName End If Mark wrote: Hi, How is the best way to show in msgbox contain some file e.g. text file? Regards Mark -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I did, I wouldn't hold back <g
There are some KB articles about working with text files, but nothing as comprehensive as that one. -- Regards, Tom Ogilvy "Dave Peterson" wrote in message ... Hmmm. Do you know of a replacement link? (I couldn't find one.) Tom Ogilvy wrote: That link doesn't work anymore. -- Regards, Tom Ogilvy "Dave Peterson" wrote in message ... If it's a small amount of text, just read it in and plop it into your msgbox. Here's a link that may help: http://support.microsoft.com/support...eio/fileio.asp Alternatively, if there's lots of stuff, you may want to just invoke NotePad. Dim myFileName As String myFileName = "C:\my documents\excel\test.txt" If Dir(myFileName) = "" Then 'do nothing Else Shell "start notepad " & myFileName End If Mark wrote: Hi, How is the best way to show in msgbox contain some file e.g. text file? Regards Mark -- Dave Peterson -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought it was a test (and I failed!). <vvbg
"Tom Ogilvy" wrote in message ... If I did, I wouldn't hold back <g There are some KB articles about working with text files, but nothing as comprehensive as that one. -- Regards, Tom Ogilvy |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And here's a sample of reading a text file:
Option Explicit Sub testme01() Dim myNumber As Long Dim myLine As String Dim myFileName As String Dim FileNum As Long myFileName = "C:\my documents\excel\text.txt" FileNum = FreeFile If Dir(myFileName) = "" Then 'not found MsgBox "File is missing!" Exit Sub Else Close FileNum Open myFileName For Input As FileNum Do While Not EOF(FileNum) Line Input #FileNum, myLine myNumber = Val(myLine) Loop Close FileNum End If End Sub This actually reads the last line of a text file (to get a number). Dave Peterson wrote: If it's a small amount of text, just read it in and plop it into your msgbox. Here's a link that may help: http://support.microsoft.com/support...eio/fileio.asp Alternatively, if there's lots of stuff, you may want to just invoke NotePad. Dim myFileName As String myFileName = "C:\my documents\excel\test.txt" If Dir(myFileName) = "" Then 'do nothing Else Shell "start notepad " & myFileName End If Mark wrote: Hi, How is the best way to show in msgbox contain some file e.g. text file? Regards Mark -- Dave Peterson -- Dave Peterson |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for reply, i a bit modified code and all work fine.
BEST REGARDS!! mark -----Original Message----- And here's a sample of reading a text file: Option Explicit Sub testme01() Dim myNumber As Long Dim myLine As String Dim myFileName As String Dim FileNum As Long myFileName = "C:\my documents\excel\text.txt" FileNum = FreeFile If Dir(myFileName) = "" Then 'not found MsgBox "File is missing!" Exit Sub Else Close FileNum Open myFileName For Input As FileNum Do While Not EOF(FileNum) Line Input #FileNum, myLine myNumber = Val(myLine) Loop Close FileNum End If End Sub This actually reads the last line of a text file (to get a number). Dave Peterson wrote: If it's a small amount of text, just read it in and plop it into your msgbox. Here's a link that may help: http://support.microsoft.com/support...ntent/fileio/f ileio.asp Alternatively, if there's lots of stuff, you may want to just invoke NotePad. Dim myFileName As String myFileName = "C:\my documents\excel\test.txt" If Dir(myFileName) = "" Then 'do nothing Else Shell "start notepad " & myFileName End If Mark wrote: Hi, How is the best way to show in msgbox contain some file e.g. text file? Regards Mark -- Dave Peterson -- Dave Peterson . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|