Run-time error '70':Hi. Welcome to AWF!
Are you getting any error messages?
Just as a test, try creating a folder in the root directory (e.g. C:\Test\) and update your code to create the text file there to see if it makes any difference.Run-time error '70':
Permission denied
Way this code dont work in accesds 2016
Private Sub C71_Click()
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
a.WriteLine ("This is a test.")
a.Close
End Sub
It's not uncommon at all. It is the default for any Windows installation since Windows 7 or even earlier.it IS possible for you to set the root folder of the C: drive to be READ only, it is uncommon on a personal standalone machine.
More likely, yes. But, not being administrator on your personal computer is also the default after a new Windows installation. Not by restricting your account permissions but by limiting the capacity of the account with UAC (User Account Control).But @sonic8, on a personal machine you are also more likely to be running as an administrator and thus can create files there anyway.
Indeed modern versions of windows almost you can't write outside your user file without administrative privileges, so try to use your user folder.Yes, it must be something with administrator rights.
There is a problem with disk C: or D: but if I try to create a file on any other disk E: or F: it works.