Path/File access error

A

Ayo

I have this macro that I created that seem to to working fine except I keep
getting the "Path/File access error" after the code as run for a while. Then
I get a "Method SaveCopyAs of Object Workbook failed" error" whenI try to
clear the initial error.
This code is suppose to loop through a range and perform a action between
the for loop below. Everything seem to be working fine, at least through 45
loops, more or less, then the error pops up. I don't know how to find the
problem so I can try and fix it.
Any ideas?

'''''''''' Beginning of For Loop ''''''''''''''
For Each c In Worksheets("RFDS Tracker").Range("A4:A" & lastRow)
Worksheets("RFDS Tracker").Activate
c.Activate
active_cell = c.Address

'''''''''' Ending of For Loop '''''''''''''''''''''
Worksheets("RFDS Form").Activate

'''''''''''' RENAME THE RFDS WORKSHEET ''''''''''''''''''''
Worksheets("RFDS Form").Select
Worksheets("RFDS Form").Name = Worksheets("RFDS Form").Range("B8").Value

'''''''''''' SAVE THE FILE ''''''''''''''''''''
fileName = ActiveSheet.Range("B8").Value & "_Ver" &
ActiveSheet.Range("I19").Value & " " _
& Format(Date, "mmm d yyyy")
ActiveWorkbook.SaveCopyAs Saveto_Folder & fileName & ".xls"

Worksheets(Left(fileName, 6)).Select
Worksheets(Left(fileName, 6)).Name = "RFDS Form"
Next c
 
A

Ayo

I just ran the code again manually and nothing happened. Everything worked as
it should with no errors.
What could be the problem. I am stumped.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top