Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
The workbook I'm developing opens with a UserForm. I'd like to put an
"About" button on the form that opens a text file that describes its functions a bit. Does Excel have a provision to open just a "read me" type file? "Open" looked it was reserved for Excel files, and "OpenText" for files to parse and import. Is one of these the right one to use, or is there a better way? Ed |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
If you want to open a text file with the intention of doing something with it
OTHER THAN putting the data on a worksheet, look at the VBA commands Open, Input#, Close, etc. On Wed, 20 Apr 2005 12:59:24 -0700, "Ed" wrote: The workbook I'm developing opens with a UserForm. I'd like to put an "About" button on the form that opens a text file that describes its functions a bit. Does Excel have a provision to open just a "read me" type file? "Open" looked it was reserved for Excel files, and "OpenText" for files to parse and import. Is one of these the right one to use, or is there a better way? Ed |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
Ed
You can use the Shell function to open it in a certain program, e.g. Notepad. ?shell("notepad.exe 'C:\Testfile.txt'") The best thing, IMO, is too make another userform with a scrollable textbox that has all this info. Then your button just shows this useform. If you want to get fancy, you could do it in html and use the webbrowser control on a userform as described here http://www.dicks-blog.com/archives/2...ng-help-files/ -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Ed wrote: The workbook I'm developing opens with a UserForm. I'd like to put an "About" button on the form that opens a text file that describes its functions a bit. Does Excel have a provision to open just a "read me" type file? "Open" looked it was reserved for Excel files, and "OpenText" for files to parse and import. Is one of these the right one to use, or is there a better way? Ed |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
Myrna:
Thanks for the reply. I tried Open with the FSO in Dim FName As String Dim num As Integer num = FreeFile() FName = "C:\Documents and Settings\myname\Desktop\ROT\TestMe.txt" Open FName For Random As #num I saw nothing happen, and tried to walk through it again - the debugger told me it was already open, but it wasn't visible anywhere, and I couldn't figure out where to put in a Visible = True property. Can you see what I did wrong? Ed "Myrna Larson" wrote in message ... If you want to open a text file with the intention of doing something with it OTHER THAN putting the data on a worksheet, look at the VBA commands Open, Input#, Close, etc. On Wed, 20 Apr 2005 12:59:24 -0700, "Ed" wrote: The workbook I'm developing opens with a UserForm. I'd like to put an "About" button on the form that opens a text file that describes its functions a bit. Does Excel have a provision to open just a "read me" type file? "Open" looked it was reserved for Excel files, and "OpenText" for files to parse and import. Is one of these the right one to use, or is there a better way? Ed |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
Dick, it worked great! Thanks.
I had considered the UserForm, but it would seem much easier to replace a simple text file for updates than to redo the text in a UserForm text box. Am I missing something? Ed "Dick Kusleika" wrote in message ... Ed You can use the Shell function to open it in a certain program, e.g. Notepad. ?shell("notepad.exe 'C:\Testfile.txt'") The best thing, IMO, is too make another userform with a scrollable textbox that has all this info. Then your button just shows this useform. If you want to get fancy, you could do it in html and use the webbrowser control on a userform as described here http://www.dicks-blog.com/archives/2...ng-help-files/ -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Ed wrote: The workbook I'm developing opens with a UserForm. I'd like to put an "About" button on the form that opens a text file that describes its functions a bit. Does Excel have a provision to open just a "read me" type file? "Open" looked it was reserved for Excel files, and "OpenText" for files to parse and import. Is one of these the right one to use, or is there a better way? Ed |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
Ed wrote:
Dick, it worked great! Thanks. I had considered the UserForm, but it would seem much easier to replace a simple text file for updates than to redo the text in a UserForm text box. Am I missing something? No, you're right, it is easier that way. I think the trade-off is how professional it looks (and how much you care about that.) I think the html and webbrowswer control is a good alternative because you can replace the html file without changing the code. If you want the best of both worlds, take Myrna's advice. Put your info in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. Dick |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
If you want the best of both worlds, take Myrna's advice. Put your info
in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. That does sound best, especially since I apparently managed to get the file open (even though I thought it wasn't working because I couldn't see it). Now I just have to figure out how to read it into a string. I think I remember something about that in either a Help file, KB article, or previous post - probably all three! But of course, that wasn't the answer I was looking for so I blew right past it! Well, I can go find it again! Thanks for the help, Dick. Ed "Dick Kusleika" wrote in message ... Ed wrote: Dick, it worked great! Thanks. I had considered the UserForm, but it would seem much easier to replace a simple text file for updates than to redo the text in a UserForm text box. Am I missing something? No, you're right, it is easier that way. I think the trade-off is how professional it looks (and how much you care about that.) I think the html and webbrowswer control is a good alternative because you can replace the html file without changing the code. If you want the best of both worlds, take Myrna's advice. Put your info in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. Dick |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
Ed
You can find most of the keywords you need here http://www.dicks-blog.com/archives/2...h-a-text-file/ like Open, Print, Input. Then check them out in help to get a description. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Ed wrote: If you want the best of both worlds, take Myrna's advice. Put your info in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. That does sound best, especially since I apparently managed to get the file open (even though I thought it wasn't working because I couldn't see it). Now I just have to figure out how to read it into a string. I think I remember something about that in either a Help file, KB article, or previous post - probably all three! But of course, that wasn't the answer I was looking for so I blew right past it! Well, I can go find it again! Thanks for the help, Dick. Ed "Dick Kusleika" wrote in message ... Ed wrote: Dick, it worked great! Thanks. I had considered the UserForm, but it would seem much easier to replace a simple text file for updates than to redo the text in a UserForm text box. Am I missing something? No, you're right, it is easier that way. I think the trade-off is how professional it looks (and how much you care about that.) I think the html and webbrowswer control is a good alternative because you can replace the html file without changing the code. If you want the best of both worlds, take Myrna's advice. Put your info in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. Dick |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
"Open" or "OpenText"?
Thank you very much! I appreciate the boost.
Ed "Dick Kusleika" wrote in message ... Ed You can find most of the keywords you need here http://www.dicks-blog.com/archives/2...h-a-text-file/ like Open, Print, Input. Then check them out in help to get a description. -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Ed wrote: If you want the best of both worlds, take Myrna's advice. Put your info in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. That does sound best, especially since I apparently managed to get the file open (even though I thought it wasn't working because I couldn't see it). Now I just have to figure out how to read it into a string. I think I remember something about that in either a Help file, KB article, or previous post - probably all three! But of course, that wasn't the answer I was looking for so I blew right past it! Well, I can go find it again! Thanks for the help, Dick. Ed "Dick Kusleika" wrote in message ... Ed wrote: Dick, it worked great! Thanks. I had considered the UserForm, but it would seem much easier to replace a simple text file for updates than to redo the text in a UserForm text box. Am I missing something? No, you're right, it is easier that way. I think the trade-off is how professional it looks (and how much you care about that.) I think the html and webbrowswer control is a good alternative because you can replace the html file without changing the code. If you want the best of both worlds, take Myrna's advice. Put your info in a text file, then use VBA's text file keywords to read the text and insert it in the textbox. It's a little more work up front coding all of that. Dick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
change "true" and "false" to "availble" and "out of stock" | Excel Worksheet Functions | |||
HELP on "left","right","find","len","substitute" functions | Excel Discussion (Misc queries) | |||
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next | New Users to Excel | |||
conditional formula to show "open" or "closed" | Excel Worksheet Functions |