LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default permission denied

I wrote the code shown below to copy certain files to a list of directories.
The list is contained in the spreadsheet to which the code is attached. I
have access to all the files and directories used, but the program is telling
me "permission denied" on the copyfile statement. I am new to VB, so maybe
I have the syntax wrong or something. Any help would be appreciated.

The code:

Sub copyauxfiles()

Dim rnum
Dim destpath As String
Dim source As String
Dim basebook As Workbook
Dim basesheet As Worksheet
Dim rowsub As Integer
Dim nrows As Long
Dim ncol As Integer
Dim arraysub As Integer
Dim fs As Object

Set fs = CreateObject("Scripting.filesystemobject")
source = "k:\budget\master files\form D.xls"
Set basebook = ThisWorkbook
Set basesheet = basebook.Worksheets("PARAMETER LIST")

nrows = basesheet.Range("a1").End(xlDown).Row

For rowsub = 1 To (nrows - 1)
destpath = "J:\budget\" & basesheet.Cells(rowsub, 1).Value & "\blank forms"
fs.copyfile source, destpath, True
Next rowsub
End Sub
 
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
error 70 - Permission denied MT Excel Programming 1 May 8th 05 07:20 AM
Permission to use object denied. Shannon Excel Programming 3 November 18th 04 11:41 PM
Permission to use object denied WilDeliver[_2_] Excel Programming 2 October 22nd 04 07:46 PM
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 10:37 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"