Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This one I can't get over.
I open a file using "job" as my file handler, but no other 'sub' can see the file handler. The debugger stops with the error "object required" Public Sub make_job_file() ' create GEO_FILE Dim fso, f1, job Const ForWriting = 2 Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateTextFile ("geo_job.job") Set f1 = fso.GetFile("geo_job.job") Set job = f1.OpenAsTextStream(ForWriting, True) End Sub Sub jobname() job_name = InputBox("input Job Name", "Job Name", job_name, 100, 1) job.WriteLine "51=" + job_name Job_date = InputBox("input correct date", "Job Date", Job_date, 100, 1) job.WriteLine "51=" + Job_date End Sub Sub station() job.WriteLine "2=" + Cells(row, B) ' AT STATION job.WriteLine "3=" + Cells(row, H) ' INSTRUMENT HEIGHT job.WriteLine "21=0.0000" ' DUMMY RO ANGLE NOT USED End Sub Can you spot where I have gone wrong. Please don't tell me one sub routine can't see another subroutine's variables. Julian B |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Default settings when opening a text file with Excel | Excel Discussion (Misc queries) | |||
How do I prevent a text to columns while opening a csv file in Excel | Excel Discussion (Misc queries) | |||
opening text file in excel problem | Excel Discussion (Misc queries) | |||
Opening a text file in excel | Excel Discussion (Misc queries) | |||
write a line from Excel to a text file | Excel Programming |