UserForm: File/Path Access Error & I/O Error

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


ADVERTISEMENT

Userform Show Path/file Error 75

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

Path/File Error Showing UserForm

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

Crashes On UserForm Show By Next Button (Path/File Error)

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

File/Path Error

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

Getting Runtime Error: Syntax Error Or Access Violation

May 3, 2006

I'm getting the error for the following piece of code.

Sub itconfandscratch()
Dim Cn As ADODB.Connection
Dim Server_Name As String
Dim Database_Name As String
Dim User_ID As String
Dim Password As String
Dim SQLStr As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Server_Name = "sturecord"
Database_Name = "Scratch" ' Enter your database name here
SQLStr = "SELECT stuname FROM dbo.sturec" ' Enter your SQL here
Set Cn = New ADODB.Connection
Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & ""..............

View 2 Replies View Related

Launching Windows Explorer Path Error

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

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 View Related

Access Sheet Name, Getting Error

Oct 28, 2006

I'm trying to loop thru the various sheets in a workbook but am having trouble accessing the current sheet name. what I have below does not work and I am stuck with how to access the current sheet name, interrogate it for what it is named, and skip processing if it is a particular name.

Private Sub dispnames()

Dim b As Integer
Dim r As Integer
Dim iSheetCount As Integer
Dim iSheet As Integer
Dim sh As Worksheet
Dim wsht As Object

iSheetCount = ActiveWorkbook.Worksheets.Count
For iSheet = 1 To iSheetCount

wsht = sh.Name
If wsht = "summary" Then
Goto skipit
End If

Worksheets(iSheet).Activate
r = Range("A" & Rows.Count).End(xlUp).Row
Range("A2:" & "A" & r).Select
Selection.Copy

Sheets("summary").Select
b = Range("Z" & Rows.Count).End(xlUp).Row + 1
Range("Z" & b).Select
ActiveSheet.Paste
skipit:
Next iSheet

View 3 Replies View Related

Error In Loading DLL On Access Of VBA Code

Apr 27, 2009

Over the weekend I did some edits to an Excel file on my home computer. This morning I did some edits to the file on my work computer. When I try to access the VBA code, I get the message "Error in loading DLL", which is error 48.

View 10 Replies View Related

Nz Causing Error When Pulling Data From Access

Mar 23, 2012

I am pulling external data from an Access 2007 database query that uses the nz function. While linking to the query, I get an "Undefined Function nz" error. The query works perfect when run in Access.

View 1 Replies View Related

VBA Lost Access To IE And Stopped Working - Runtime 438 Error

Feb 17, 2013

I'm scraping a website for some data using the following program. The program was working as expected until I decided to add a save file element that was a copy paste of some code a friend gave me (attached below). Funny thing is the save file functionality works but now I can't get IE to load the webpage - I get a 438 Error. I'm thinking there's a problem with something in the references menu.

Code:
Sub GET_PVI()
Dim Days_in_Month(1 To 12) As Integer
Dim Name As String

[Code]....

View 2 Replies View Related

Pass Data From Userform To Excel Sheet Using File Path?

Jan 18, 2012

How to pass data from userform to excel sheet using file path?

View 4 Replies View Related

Excel Code Works Fine But Error When Called From Access?

Apr 11, 2012

This code works fine when I run it in Excel.

Code:

Sub RemoveCodeAndSave()
'Remove all code from ThisWorkbook code module
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule.DeleteLines 1, _

[Code]....

I get the error "Run-time error 440: The specified dimension is not valid for the current chart type" why I am getting this. The macro does everything I want it to, except for throwing the error at the end.

View 3 Replies View Related

Runtime Error 1004 When Opening Excel From Access Upon Second Execution

Jul 16, 2014

The following script runs fine the first time I click the command button on an Access form but after I close the Excel workbook and click the command button again to edit a new spreadsheet, I get the follow error message:

Run-time error '1004': Method "Columns' of object'_Global failed.

It fails here:

Code:
Columns("H:H").Select

The script is being run from Access 2007 and is opening a spreadsheet in Excel 2007 (but using xls extension)

Code:
Private Sub IdahotoExcel_Click()
Dim dlg As FileDialog
Dim idahofile As String

[Code].....

View 5 Replies View Related

Run Time Error 1004 (macro Called From Access Module)

Nov 19, 2008

i am running a macro thru vba (beiing called from a ms access module) and am getting a RuntTimeError 1004.

the code opens a workbook...then open a second workbook (which houses the macro) then activates the desired worksheet and call the Maco via the run command but errors out.

if i open the workbook and set focus on the desired sheet ....tool>macro>desired macro name it runs fine.

the line of code in the macro is: "ActiveCell.Offset(1, 0).Activate"

View 9 Replies View Related

Save Hyperlink Path For File With Absolute Path And Non-Relative?

Mar 4, 2013

is it possible to configure Excel in order to save the Hyperlink path for a file with absolute path and non relative?

I notice that the hyperlink is ....pdf ry.pdf

if I change the position of the file excel there is a problem!

I would like to save es. d:invoichepdf ry.pdf

View 1 Replies View Related

Trim Full File Name & Path To File Path Only

Sep 27, 2006

I have a variable ("DestFile") that defines a path to a file (used in saving the file)...

I'm in the process of getting a Sub to hyperlink to this file, but in some circumstances, I may only want to hyperlink to the folder, not the actual file...

How would I go about trimming the "DestFile" address to get a "DestFldr" address?...

An example of "DestFile" might be;
S:BryanFor KenGulf ConstructionST0609014-t.xls
(the file name length may vary)
What code can I use to consistently trim it back to;
S:BryanFor KenGulf Construction
as the "DestFldr" variable?

View 4 Replies View Related

Macro Error - First Sheet In Each File To Master File

Mar 7, 2012

I am receiving an error at

Set CopyRng = Wkb.worksheet1.Range(Cells(RowofCopyworksheet, 1),
Cells(Cells(Rows.Count, 1).End(xlUp).Row, Cells(1, Columns.Count).End(xlToLeft).Column))

I am trying to copy the first sheet in each file in the designated folder and paste it into a master worksheet.

Below is the code.

'Description: Combines all files in a specific folder to Format File for Upload.xls
Sub MergeMultipleFiles()
Dim path As String, ThisWB As String, lngFilecounter As Long
Dim wbDest As Workbook, shtDest As Worksheet, ws As Worksheet
Dim filename As String, Wkb As Workbook
Dim CopyRng As Range, Dest As Range
Dim RowofCopySheet As Integer

[Code] ....

View 1 Replies View Related

Open File Macro, Error - Incrementing File Name

Feb 2, 2007

When it opens the desired file, it increments the file name by 1 each time it is opened (via the macro).

Example;
The first time it is opened you see the file name in the header read "P'Binder L&T Pages" for a moment, then it changes to "P'Binder L&T Pages1"...
I close the file and open it again (via the macro), and see the file name in the header read "P'Binder L&T Pages" for a moment, then it changes to "P'Binder L&T Pages2"...
The file name continues to increment on every opening until the PC is rebooted, then it starts at 1 again.

Sub OpnLTpages()

Dim wb As Workbook
Dim AlreadyOpen As Boolean

AlreadyOpen = False

For Each wb In Workbooks 'Scan open workbooks
If wb.Name = "P'Binder L&T Pages.xls" Then ........................

View 9 Replies View Related

Userform Run Error

May 9, 2008

have a look at this and tell me why i cant even give it a trail run without getting an error

[url]

View 13 Replies View Related

VBA Userform Error 424

May 11, 2009

I keep getting an Run-time error '424': Object required error whenever I try to run a macro with a rather involved user form. I know the code for the form is what is keeping it from running properly. Here is the code for the form:

View 6 Replies View Related

Macro To Separate File Name And Path From Complete Path

Oct 3, 2012

I want to run a macro to separate File Name and Path from the given complete path

For Example

Code:

In Column A : Given Complete Path " C:MainFolderRecordsSubFilesFile1Record.pdf

I need it separeted like

Code:

In Column B :File Name = Record.pdf
In Column C :File Path = C:MainFolderRecordsSubFilesFile1

Is there any way to do this through a macro

View 2 Replies View Related

UserForm As Add-In (Getting Error 9 On .show)

Sep 2, 2009

I have a userform that is working perfectly, but when I try to make it an add-in I can't even get it to load. When loading the userform as an add-in I get the error "Run error nr. '9'.: The Index is out of the interval" (freely translated from Swedish to English). The code I'm using to load the userform is

View 3 Replies View Related

Userform On Top Of Another -> Runtime Error 402

Oct 20, 2011

I have an application using two userforms. Following sequence is used:

1. Open Userform1 (with uf.show)
2. click on a commandbutton in userform1 opens a second userform on top of userform1.
3. Close userform2 with commandbutton on userform2 (userform2.hide)
(I did not want the user to close the UF via the "X" )

Runtime error 402 : Must close or hide topmost modal form first

So, I changed my code so when the user clicks the commandbutton in userform2

userform1.hide (which is the topmost)
userform2.hide

But again I get the same error.

View 7 Replies View Related

UserForm - Automation Error

Aug 5, 2008

I created a UserForm (userform1) and added a label to it which essentially just says: "Pick a Colour"...

The other UF controls are added on the fly using the below code...however when I try to add the event to each button I get the Automation Error but I don't really understand how / why... the events are actually added to the VB project ok...

Private Sub UserForm_Initialize()
Dim NewButton As MSForms.CommandButton
Dim ws_i, line As Integer
Dim clr_str As String
For Each ws In ActiveWorkbook.Worksheets

I added a dummy routine for test purposes which is to be invoked on click of UF button control (I have tried placing this code in a standard module, within UF module etc to no avail):

Sub HIDE_WS(clr_id As Long)
MsgBox clr_id
End Sub

So to reiterate -- when I invoke the initialisation of the UF I get the following error:


Automation Error
The object invoked has disonnected from its clients

All events are added for each control.

If I remove the adding of the events I know the UF populates with the correct controls etc...

View 9 Replies View Related

Clicking On UserForm Gives An Error 13

Jan 20, 2010

When I click on the userform that opens when the workbook does I get this error:

Run-time error '13':
Type Mismatch

This is the code highlighted

DT=UserForm1.TextBox3.Text

View 9 Replies View Related

UserForm Initialize Error 13

Feb 17, 2010

The initialization code of a userform I'm using has started causing me 'Runtime Error 13, Type Missmatch' and I can't figure out why. Can anyone see a reason why I may be experiencing this,

Private Sub UserForm_Initialize()
'Get Last Entry
Dim countnonblank As Integer, myRange As Range
Dim SDate As Date, SDateRange As String, EDate As Date
Dim SDateString As String, EDateString As String, DirString As String

'count cells with data in them
Set myRange = Sheets("textfilemerger").Range("A:A")
countnonblank = Application.WorksheetFunction.CountA(myRange)
'decide if data is present or not
If countnonblank = 1 Then.............................

View 9 Replies View Related

Error When Initializing UserForm

Jul 4, 2006

I am populating a UserForm from some ranges on my workbook. All is well EXCEPT for the third guy down- "lstCheckDep". The only difference I can figure out is that the cell it is drawing from has a date format. How can I adjust for this so that it's contents can go on the UserForm, without getting hung up on the formatting?

Private Sub UserForm_Initialize()
lblCandidate.Caption = Range("Rcandnam").Value & " - #" & Range("ID").Value
lstCheckCntry = Range("RCountry").Value
lstCheckDep = Range("RDeparture").Value
lstCheckTrack = Range("rTrack").Value
lstCheckLang = Range("Lang").Value
End Sub

View 4 Replies View Related

UserForm Show Causes Error On 1 PC

Feb 20, 2008

I've created a userform on one computer which launchs when I open the excel workbook. The userform contains comboboxs and a picture. But when i saved it on another computer and tried to open it and it errors. (Run-Time error 9). (Still works fine on the computer that created it). All references are to this workbook only. Userform is contained within the Forms folder of this workbook(not personal.xls) and the userform name is PDM_SPLASH1. Also, if i go into VBA I can see the form, but it wont launch when i try to play in manually. (Run-Time error 9)

Private Sub Workbook_Open()
Worksheets("Launch Page").Select
Worksheets("Instructions").Visible = False
Worksheets("SelectDB2").Visible = False
Worksheets("REPALIGNMENT").Visible = False
Worksheets("PDM").Visible = False
Worksheets("TABLES").Visible = False
Worksheets("DISPENSING").Visible = False
Worksheets("DISPENSED").Visible = False
Worksheets("OpportunityAnalysis").Visible = False
Worksheets("ENGINE1").Visible = False
Worksheets("POTENTIALCONTRACTLOSS").Visible = False
PDM_SPLASH1.Show
End Sub

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved