Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Permissions issue that I cannot solve
Hey everyone, the topic pretty much says what my problem is. I create file then I think that I close it off correctly. I late come back an delete the file and for whatever reason it says permission is denied. Here is the code where I create the file: Code ------------------- Public Function fedit() fname = UserForm1.ListBox1.Value NameBox.Text = fname Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.getfile("C:\Documents and Settings\a2001822\Desktop\DatalinkExcel\" & fname & ".txt") Set fed = f.openastextstream(1, 0) Do While fed.AtEndOfStream < True highlight = fed.ReadLine If highlight < 100 Then ListBox1.Selected(highlight) = True End If Loop fed.Close Set fed = Nothing Set f = Nothing Set fs = Nothing End Function ------------------- Here is the code where I try and delete the file: Code: Code ------------------- Private Sub EditProfile_Click() original = UserForm1.ListBox1.Value UserForm3.Show Set fs = CreateObject("scripting.filesystemobject") fs.deletefile ("C:\Documents and Settings\a2001822\Desktop\DatalinkExcel\" & original & ".txt") Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.getfile("C:\Documents and Settings\a2001822\Desktop\DatalinkExcel\placeholde r.txt") f.Name = original & ".txt" End Sub ------------------- The actual error is on this line: Code: Code ------------------- fs.deletefile ("C:\Documents and Settings\a2001822\Desktop\DatalinkExcel\" & original & ".txt") ------------------- Any and all input will be appreciated. Thanks ~ -- jclark41 ----------------------------------------------------------------------- jclark419's Profile: http://www.excelforum.com/member.php...fo&userid=2543 View this thread: http://www.excelforum.com/showthread.php?threadid=56146 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Use Permissions | Excel Discussion (Misc queries) | |||
How can I solve the issue of forgotten password in "sheet"? | Excel Discussion (Misc queries) | |||
Permissions | Excel Worksheet Functions | |||
Permissions | Excel Discussion (Misc queries) | |||
Permissions | Excel Worksheet Functions |