vba_php
Forum Troll
- Local time
- Today, 12:02
- Joined
- Oct 6, 2019
- Messages
- 2,880
I have searched high and low as to what could be causing this but i can't seem to fix the stupid thing. here's the simple code:
I have even tried running it the normal way:
with no luck. Could it be happening because I'm running a trial version of access as a part of a trial version of office 365?
Code:
Dim fso As Scripting.FileSystemObject
Dim tsTxtFile As Scripting.TextStream
' (1) Open an instance of the FileSystemObject.
Set fso = New Scripting.FileSystemObject
' (2) Open an instance of the FileSystemObject TextStream class.
Set tsTxtFile = fso.CreateTextFile("C:\test.txt", True)
tsTxtFile.Close
Code:
' Dim obj_fso As Object
Dim oFile As Object
Set obj_fso = CreateObject("Scripting.FileSystemObject")
If obj_fso.FileExists("c:\test.txt") Then
Kill "c:\test.txt"
End If
Set oFile = obj_fso.CreateTextFile("c:\test.txt", True)
oFile.Close