Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a check list that we use to verify computer builds. I would like to write code for a checkbox that wouls open a text file on a server. I have tried 2 ways, neither work. Private Sub Printers_Click() Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile("\\usshl2-dplfsd01\data$\documentation\printers.txt", ForAppending, TristateFalse) End Sub open \\usshl2-dplfsd01\data$\documentatio\printers.txt for random as #1 There must be a simple solution..... TIA, Mike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VBA built in routines should be sufficient.
If this is an ANSI text file, then don't open in binary. Also, is that path correct ? "documentatio" The path/filename is a string, so enclose it in quotes. And look at FreeFile in the help Dim FileNum As Long FileNum = FreeFile Open "\\usshl2-dplfsd01\data$\documentation\printers.txt" For Input As #FileNum '...etc NickHK "lumpy04" wrote in message ... Hello, I have a check list that we use to verify computer builds. I would like to write code for a checkbox that wouls open a text file on a server. I have tried 2 ways, neither work. Private Sub Printers_Click() Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile("\\usshl2-dplfsd01\data$\documentation\printers.txt", ForAppending, TristateFalse) End Sub open \\usshl2-dplfsd01\data$\documentatio\printers.txt for random as #1 There must be a simple solution..... TIA, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
from VBA open text file in default text editor application | Excel Programming | |||
Open CSV file, format data and write output to a text file. | Excel Programming | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
Open delimited text file to excel without changing data in that file | Excel Programming |