Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Permission Denied

Hello

I have a procedue to list down my files in my computer onto an Excel Sheet.

It worked perfectly. Actually I got it from this forum.

However I get the above error message.

Help gives 4 explanations including something like 'I have tried to
something with registry" or "I have tried to open a file for sequencial
output and append".

But why now? Why not before?

Thank You
M Varnendra

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Permission Denied

It would be helpful to see your code. It also might be helpful to know what
it's trying to access when it give this error.
--
HTH,

Barb Reinhardt



"Varne" wrote:

Hello

I have a procedue to list down my files in my computer onto an Excel Sheet.

It worked perfectly. Actually I got it from this forum.

However I get the above error message.

Help gives 4 explanations including something like 'I have tried to
something with registry" or "I have tried to open a file for sequencial
output and append".

But why now? Why not before?

Thank You
M Varnendra

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Permission Denied

Hi Mate

Here you go;

Sub FileListing()

Dim FSO As Scripting.FileSystemObject
Dim FF As Scripting.Folder
Dim StartFolder As String
Dim StartCell As Range
Dim Indent As Boolean
Dim ListFiles As Boolean

StartFolder = InputBox("Enter folder path:")
If StartFolder = vbNullString Then
Exit Sub
End If
If Dir(StartFolder, vbDirectory) = vbNullString Then
Exit Sub
End If
On Error Resume Next
Set StartCell = Application.InputBox( _
prompt:="Select start cell.", Type:=8)
If StartCell Is Nothing Then
Exit Sub
End If
On Error GoTo 0

Indent = MsgBox("Indent listing?", vbYesNo) = vbYes
ListFiles = MsgBox("List files?", vbYesNo) = vbYes


Set FSO = New Scripting.FileSystemObject
Set FF = FSO.GetFolder(StartFolder)
DoFolder FF, StartCell, ListFiles, Indent


End Sub

Sub DoFolder(FF As Scripting.Folder, R As Range, ListFiles As Boolean,
Indent As Boolean)

Dim F As Scripting.File
Dim SubF As Scripting.Folder

R.Value = FF.Path
If Indent = True Then
Set R = R(1, 2)
End If
If ListFiles = True Then
For Each F In FF.Files
Set R = R(2, 1)
R.Value = F.Name
Next F
End If
Set R = R(2, 1)
For Each SubF In FF.SubFolders
DoFolder SubF, R, ListFiles, Indent
Next SubF
If Indent Then
Set R = R(1, 0)
End If

End Sub

When Done Before Now

C:\ C:\
autoexec.bat autoexec.bat
bootmgr bootmgr
config.sys config.sys
dell.sdr dell.sdr
hiberfil.sys hiberfil.sys
newfile.enc newfile.enc
newkey newkey
pagefile.sys pagefile.sys
C:\$RECYCLE.BIN C:\$RECYCLE.BIN
CIMA.doc desktop.ini desktop.ini
Dat.xlsx C:\$RECYCLE.BIN\ C:\$RECYCLE.BIN\

The code stops with C:\$RECYCLE.BIN\----------- (I ahve taken out the
digits). Almost all my directories and files are in C.

Thanks


"Barb Reinhardt" wrote:

It would be helpful to see your code. It also might be helpful to know what
it's trying to access when it give this error.
--
HTH,

Barb Reinhardt



"Varne" wrote:

Hello

I have a procedue to list down my files in my computer onto an Excel Sheet.

It worked perfectly. Actually I got it from this forum.

However I get the above error message.

Help gives 4 explanations including something like 'I have tried to
something with registry" or "I have tried to open a file for sequencial
output and append".

But why now? Why not before?

Thank You
M Varnendra

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
CopyFolder Permission Denied, but who by? DartGuru Excel Programming 0 April 27th 07 09:05 AM
permission denied SandyR Excel Programming 2 November 16th 05 01:53 PM
error 70 - Permission denied MT Excel Programming 1 May 8th 05 07:20 AM
Permission Denied Error 70 Tom Ogilvy Excel Programming 0 August 3rd 04 04:56 PM
Permission Denied Audrey Ng Excel Programming 1 October 1st 03 07:20 AM


All times are GMT +1. The time now is 04:26 AM.

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

About Us

"It's about Microsoft Excel"