Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Use Permissions Kev - Radio Man Excel Discussion (Misc queries) 0 May 16th 09 09:10 AM
How can I solve the issue of forgotten password in "sheet"? Marzi Excel Discussion (Misc queries) 1 August 6th 08 12:49 PM
Permissions Mike Busch[_2_] Excel Worksheet Functions 2 December 19th 07 02:59 PM
Permissions will07 Excel Discussion (Misc queries) 1 November 23rd 07 02:49 AM
Permissions Paul Excel Worksheet Functions 0 November 23rd 06 10:58 AM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"