MoveFolder. Run-time Error 76, Path Not Found
Jun 13, 2007
I am getting the following run time error when trying to use MoveFolder from the scripting runtime library:
run-time error ‘76’
path not found
The source and destination paths are picked up out of cells and I think the spaces in the name or the length of the path names may be causing the problem.
The source folder looks something like this (contains 50 characters):
K:Example123 Folder1AB CD ESubfold,XX abcdefgh
The destination folder looks something like this (contains 60 characters):
K:Example123 Folder1XX New123AB CD ESubfold,XX abcdefgh
The code is pretty basic:
Sub MoveFolder(Sourcepath As String, Destinationpath As String)
Dim FSO As Scripting.FileSystemObject
Set FSO = New Scripting.FileSystemObject
'some code here removes the trailing backslashes on the
'end of the pathnames
FSO.MoveFolder Sourcepath, Destinationpath
End Sub
I have double checked the source path name exists. I have also tried doing it manually with the path names being entered in as text but i keep getting the error.
View 9 Replies
ADVERTISEMENT
Sep 25, 2008
This macro starts out looking for the first non blank cell by looking down about a hundred cells and then going back up till it finds the first non blank cell. When it finds the first non-blank cell it goes up 1 row and adds 1 to the number for the next row. It works fine the first time then, after the file is saved it will stop the macro with the following message; Run-time error ‘1004’ No cells were found. If I format the cells in question, the macro works again until I save the file, then it happens again.
Excel 2003 11.8220.8221 SP3
I think there is a hotfix for this but I can't get it to install. Is there a way around this?
This is the portion of the code that gets the error:
Range("A11:A100").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
ActiveCell.FormulaR1C1 = "=+R[-1]C+1"
View 9 Replies
View Related
Dec 9, 2009
The script below scans through a specified folder on a network and scans every xls file inside that folder for a value. When it finds the spreadsheet which contains that value (a policy number) it outputs some of the data from the matching file and also provides a link to the sheet in question.
It worked perfectly until I saved, exited and re-opened the file and now I am getting a 1004 run-time error every time I try and execute the script.
I cant for the life of me work out a cause.
More baffling, the wording of the error says that the file 'R:DirCancellations.xls' could not be found.
At no point is a file called 'Cancellations.xls' specified. Why has the script decided to search for a file called 'Cancellations'?
Sub Search()
ActiveSheet.unprotect
ActiveWorkbook.unprotect
Dim wb As Workbook
Dim TheFile As String
Dim MyPath As String
Dim DirLoc As String
Dim PolNum As String
ActiveSheet.Range("C13:G25").ClearContents................
View 9 Replies
View Related
Dec 28, 2006
I've followed a couple of the FSO threads and come up with the code below however I keep getting a 'Runtime Error 76 - Path not found'.
Sub scan_station()
Dim FSO As New FileSystemObject
Dim dest As String
Dim dname As String
dest = "L:eBISScan Station"
dname = "Scans(" & Date & ").csv"
FSO.copyfile "H: odaysscans.csv", dest & dname
End Sub
It hangs at the area coloured red. However if I hard code the full path and name as I've done with the source information it works fine.
View 3 Replies
View Related
Dec 19, 2006
the spreadsheet needs to be copied to a directory called "C:downloads" as it contains a ODBC query to itself (In reality, this is a query to an External Oracle Database)
On loading, it should pop up a simple userform, with a combo and two command buttons, which when pressed takes you to a (hidden) tab that displays a pivottable.
All works well until I try to close /save when 60% of the time, Excel encounters problems and closes and will not load up the file the next time until either quit excel or disable macros. Messages include "file/path access error", "I/O Error" or get restarts excel.
On a casual run through, I expect you might report back that "All worked ok for me". Please can you give it a bit of a thrashing, comment out the userform show, save the file (frequently) becuase i assure you it will break ultimately!
This is a brand-new file and I've tried it on about 5 different PC running different versions of Excel and generally get the same result.
View 7 Replies
View Related
Jul 2, 2006
the if stattement works perfectly and does exactly what i want except when it comes to the else part. if there is no error the statements are run perfectly but if there is an error (in this case the error is generated when a match cannot be found in the spreadsheet) the else statement doesnt kick in and post the msgbox.
the code just crashes. and returns an error 1004 on the line i have highlighted in yellow
res = WorksheetFunction.Match(invvar, Columns(1), 0)
If Not IsError(res) Then
Me.txtClientID.Value = ws13. Cells(res, 7)
Me.txtNumber.Value = ws13.Cells(res, 7)
Me.txtDate.Value = ws13.Cells(res, 8)
'save client id as a variable
'Print to invoice------------------------------------------------------------------.....................
View 6 Replies
View Related
Apr 26, 2006
I have some code that, although works fine in Excel 2003, does not in Excel 1997. I receive this error when I try running it:
COMPILE ERROR:
NAMED ARGUMENT NOT FOUND
Sub HPVAL()
Dim r As Range, myStr As String
myStr = "HP"
Set r = Cells. Find(What:=myStr, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False)
If Not r Is Nothing Then
r = r.Value
While Not r Is Nothing
Set r = Cells.FindNext(r)
If Not r Is Nothing Then
r = r.Value
End If
Wend
End If
End Sub
It looks like Excel is getting hung up on the "SearchFormat:=" portion of the code.
View 2 Replies
View Related
Nov 19, 2009
We have built quite a large Excel based program that contains quite a lot of coding. the program seems to work fine the majority of the time but every so often we recieve an error message that causes excel to not save, or to crash and shut down.
The message that comes up is "File/Path Error"
Now I've just done some hunting around online and some links I have found speak of declairing the document location correctly in the coding. I was wondering could this be the issue at hand?
Anytime the document needs to save, there is a cell with the directory path and file path declared as a variable (Actually as Dim String) within the coding. Is this the best way to declare a file path?
Also, the problem seems intermittent. We Compile the VBA coding before saving, we also use a Clean Project add-in within Excel. These processes usually help but every so often the problem comes back.
View 9 Replies
View Related
Jan 5, 2010
I have an excel 2003 template containing a userform that is displayed using the workbook_open event.
The userform causes excel to crash with file/path error 75. i have tried many suggestions given on ozgrid and several other forums with no joy.
When the userform crashes, the debugger stops on DataFormNew.show.
I have added stop commands in the initialise procedure to see what is going on and it appears that my userform has disappeared!
to upload the excel template and any other information required to get this sorted.
its size is 765 KB which exceeds the size limit to attach to the post.
here is the workbook_open macro:
Private Sub Workbook_Open()
'On Error GoTo MyError
'Call UnProtectAll
'Dim frm As UserForm
'For Each frm In UserForms
' Unload frm
'Next
View 9 Replies
View Related
Dec 12, 2006
The attached spreadsheet is as simple as it gets - a single userform with a combo box that allows 1 of 4 choices. It gets loaded and displayed in the workbook_open() event - or at least it should - but 9/10 times i get the message "Path/File error" and debug crashes out on the userform.show line. The next time I try and open the file (despite not saving it) Excel crashes and closes! Even re-starting Excel does not allow the file to be opened!
If, however, I open the file with macros disabled, and go into the VBE and manually run the workbook_open() all works fine. I'm using Excel 2003 and I've tried it on other installations - sometimes it will work, other times not.
I've tried every combination of userform load, unload, hide & show with similar results.
View 9 Replies
View Related
May 27, 2007
I am trying to launch windows explorer from within excel vba. The routine below is borrowed from another post on this site and modified for my purposes.
Sub LaunchWindowsExplorer()
Dim PID As Double
Dim strRootPath As String
Const strExpExe = "explorer.exe"
Const strArg = " " '" /e,/root, "
'// Change rootpath here
strRootPath = "J:MyDirectoryWilliams,Bob 7264" ..............
View 9 Replies
View Related
Dec 17, 2009
The error that pops up has no information other than "File not found" in a dialog box with two buttons.
File not found (Error 53)
The file was not found where specified. This error has the following causes and solutions:
A statement, for example, Kill, Name, or Open, refers to a file that doesn't exist.
Check the spelling of the file name and the path specification.
An attempt has been made to call a procedure in a dynamic-link library (DLL) or Macintosh code resource, but the library or resource file name specified in the Lib clause of the Declare statement can't be found.
Check the spelling of the file name and the path specification.
In the development environment, this error occurs if you attempt to open a project or load a text file that doesn't exist.
Check the spelling of the project name or file name and the path specification.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).
View 3 Replies
View Related
May 16, 2009
I have a macro which prepares a report for equipment. The macro is a recorded macro and it runs perfectly on my system but when i am trying to run that in other system getting an error message"Error 448:arugument not found".Which i marked in red.
My macro code is as follows:
Sub Anirudha()
Application.ScreenUpdating = False
Range("G2").Select
ActiveCell.FormulaR1C1 = "=MID(RC4,4,6)"
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G931")
Range("G2:G931").Select
Range("A2:F2").Select
View 9 Replies
View Related
Nov 6, 2006
I am trying to open an Add-In file (that I wrote) and I am now getting the following error "File Not Found". I am sure it has to do with a typo in the code or something.
However, I cannot get anything to open up so that I can see the VBA code. The spreadsheet itself does not contain any data, just the VBA project.
how I can get at the code to fix it?
I tried to upload the file, but it is too big for the requirements.
View 9 Replies
View Related
Aug 7, 2008
When loading my workbook, my userform loads perfect, but when I go to hit the "next" button. It crashes with the error:
"Path/File access error."
The next button code, quite simple: ....
View 9 Replies
View Related
Mar 7, 2013
I have a worksheet with several option buttons and until yesterday, I had no problem selecting them. But today, every time, I select a radio button, an error shows up stating "Cannot run Macro "Option Button_click. Macro is not available in this workbook or is disabled". When the user selects a radio button, text appears in Col B depending on what button was selected (using VLOOKUP). That stuff is still working fine. It's just as soon as I click a radio button, the error shows up.
Based on the radio button selected, user can add in information to the columns adjacent to it, and then click a button to store that information in some rows below. The code for that button is stored in the sheet module. I have tried enabling macros and disabling macros and no change has appeared. What I have noticed though is that yesterday, when i opened the workbook, a yellow bar appeared asking if I wanted to "Enable Content". Today, that bar didn't appear.
View 1 Replies
View Related
Dec 18, 2008
Anyone ever seen this error “File not found: VBA6.DLL” ?
This error happens when I press a button I’ve created in the sheet. Funny thing is that there are other buttons right beside this button and they all work just fine. I’ve checked the code and names of all the macros in the sheet.
I’ve recreated a different module and renamed the macro and attached the code to another button.
View 3 Replies
View Related
Feb 8, 2012
I manage to do a proper search and the return value is correct, but the problem is when I don't get the correct value excel gives me an error, what I can add to make the result just to give me MsgBox "Not found"?
Code below:
Set Ran = Worksheets(2).Range("A:A").Find(CompName, lookat:=xlPart)
If Not Ran Is Nothing Then
MatchRow = Ran.Row
MatchCol = Ran.Column
End If
View 5 Replies
View Related
Dec 4, 2012
I am getting a "Runtime Error 53 - File not Found" with the below code. I am trying to move xml files from one folder to another. The file exists as my other macro can access the xml files and extract the info. But I can't get the macro to move them! Removing the last slash in the folder address hasn't worked either.
HTML Code:
Public Sub move()
Dim MyFolder As String
Dim NewFolder As String
Dim MyFile As String
[Code] .............
View 3 Replies
View Related
Feb 12, 2013
I'm trying to write some VBA which will allow me to find certain instances of data across a number of different sheets and copy this into another sheet.
However if the sheet doesn't contain the data I'm searching for an error pops up and the macro dies, is there a way to search where if the macro doesn't find anything it skips to the next line?
View 1 Replies
View Related
Oct 1, 2013
I am new to VBA and created the following code:
Sub UpdateSchedule()
'
' UpdateSchedule Macro
' Save changes to schedule, create import table for MRP, and timestamp.
'
' Keyboard Shortcut: Ctrl+Shift+U
[Code] ...
When I run it it tells me that "No cells were found and the debugger highlights the following line of code:
Range("Import[FG GP'#]").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
I have tried inserting:
On Error Resume Next
Range("Import[FG GP'#]").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
This makes everything work except the deleting.
View 7 Replies
View Related
Oct 4, 2009
Private Sub Worksheet_Activate()
Sheets("Search Inv").Protect UserInterFaceOnly:=True
ActiveSheet.Range("A17:F37,C39:C42,F39:F42").Select
Selection.SpecialCells(xlCellTypeConstants, 23).Select
Selection.ClearContents
End Sub
Above is meant to clear the contents of cells that contain formulas while keeping the formulas.
The sheet is protected ... no password
What is wrong ... when I activate the sheet I get: Run Time error 1004 / no cells found
(All cells that are meant to be cleared are selected ... they just don't clear)
View 9 Replies
View Related
Jan 23, 2007
I wrote a program in Excel that calls a form to load when an action happens on a spreadsheet page, the code I used to call the form from is
sqe_portal.UserForm_Initialize
however since upgrading to MSoffice 2003 i get the runtime error '53' file not found. the files still their...? any ideas?
View 9 Replies
View Related
Jan 1, 2013
I build a VBA that search for 445 files in folders on specific path.
The code opens each file, take each time the same 31 rows, filter them and paste in the main data base file and then close the origin file.
So, for 445 files it takes about 6:30 minutes.
View 4 Replies
View Related
Feb 9, 2010
With this macro i print nine sheets. If there is one missing, excel gives a warning that the document cannot be found. I want excel to go ahead with the following document.
View 4 Replies
View Related
Jan 11, 2006
If lookup doesn't find a match in the first column, can I get it to return an
"ERR" or "0", something that would let me know there was no match? Right now
it returns the value in the second column of the closest value.
View 13 Replies
View Related
Sep 13, 2003
when I try to do this:
Private Sub Workbook_Open()
UserForm1.show vbnomode
End Sub
I get one of those "Excel has found an error and needs to close......"
and it crashes down
View 9 Replies
View Related
Dec 19, 2007
I have error trapping in place so if a find in a column returns no data the procedure continues, but the code breaks there anyway.
In Tools/Options/General/Error Trapping I have Break on Unhandled Errors checked.
I have changed my error trapping lables.
I have copied the procedure and renamed it.
View 8 Replies
View Related
Feb 27, 2012
trying to convert an excel document to an XML document and am getting the above error. Microsoft Visual Basic highlights below.
Code:
' prompt user to save to a directory
With frmAuthenticate.dlg
.Filter = "XML Files |*.xml|"
[Code]....
View 9 Replies
View Related
Oct 3, 2013
I've got an interactive chart on a sheet where users select a chart from a combo box control and a picture link to the chart is displayed. The actual charts are on a hidden sheet. I have to activate the charts first for it to work so I put a button the sheet and recorded a macro where I unhide the hidden sheet, select each chart as I scroll down the screen by clicking on it then hide the sheet again and return to the interactive chart.
My problem is that I'm getting an error when the macro tries to select the first chart which is called "Chart 6":
Run-time error '-2147024809 (80070057)':
The item with the specified name wasn't found
I recorded the macro so I'm not sure why the macro isn't working now.
Code:
Sub ResetCharts()
'
' ResetCharts Macro
' Reset all charts
'
'
Sheets("Budget v Actual Graphs").Select
Sheets("Graph BG").Visible = True
ActiveSheet.ChartObjects("Chart 6").Activate
ActiveChart.ChartArea.Select
ActiveWindow.SmallScroll Down:=15
ActiveSheet.ChartObjects("Chart 35").Activate
[Code] ............
View 5 Replies
View Related