Does the path "\Documents and Settings\AcuTrack\" exist on the device already? 
If it doesn't, then the openfile call will probably fail.

Also, this might not cause an issue with creating the file, but I can see the 
newobjects getting somewhat confused in that you're setting file2 to be a child 
of itself. Would make more sense to do the original addObject line as file1, 
and then set file2 = file1.openfile(...)

--- In [email protected], "georgeewalters" <gwalt...@...> wrote:
>
> Does anyone see why this code does not create a file? I was expecting 
> StockCount.txt to exist even if nothing was written to it. MsgBox said count 
> was 1 and list was not empty. I've no idea why the file does not exist.
> 
>       AddObject("newObjects.utilctls.SFMain"), "file2"    
> 
>     On Error Resume Next    
>       Set file2 = file2.OpenFile ("\Documents and 
> Settings\AcuTrack\StockCount.txt", 1)
>     If err.Number > 0 Then
>         MsgBox("Can't open StockCount.txt for save "  & err.Description)
>         On Error Goto 0        
>         Exit Sub
>     End If
>     MsgBox (count)
>     For i = 1 To count
>         For j = 0 to 3
>             tmp = tmp & list(i,j)
>         Next
>         file2.Write tmp
>         MsgBox (tmp)
>     Next
>     
>     file2.Close
>     
>     MsgBox("File saved")
>     ItemNbr.SetFocus
>


-- 
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en.

Reply via email to