Close Window
Free Ebook
Get Your Free Excel
Top 15 Excel Tutorials from
Instant Access!

Error Accessing File. Network Connection May Have Been Lost

Hello all.

I have this form that I use with the Switchboard for a menu. It has worked fantastic until yesterday afternoon when the users started getting the message I referenced in the title.

After selecting O.K., Microsoft Visual Basic Pops open with the code for the form. I can't see anything wrong with it.

Any idea as to why we would be receiving this message? I have MS Access 2000/SR-1.

Thanks for your help.

Free Excel Courses

Similar Excel Tutorials

Macro to get data from a workbook, closed or open, over a network or locally on your computer. This is a versatile ...

How to add, manage, and remove error bars in charts in Excel. Error bars allow you to show the potential variance ...

How to prevent errors from appearing in formulas in Excel. This is especially helpful for the Vlookup function. Sec ...

How to remove the #N/A error from Vlookup and replace it with a friendly message or a blank cell. Fix the Vlookup ...

Helpful Excel Macros

- This free macro will open the Microsoft Word program on your computer. You do need to have this program first. This wi

- This free macro will open the Microsoft PowerPoint program on your computer. You do need to have this program first. T

- This free macro will open the Microsoft Outlook program on your computer. You do need to have this program first. This

- Add data validation input messages to cells in Excel with this free Excel macro. These messages appear when a specific

- This free macro for Microsoft Excel allows you to open any PowerPoint presentation from excel. You can change the file

Similar Topics

I have an excel 2007 file sitting in a shared network folder. I only want one user to be able to make changes at a time (any other users would get a read-only). For some reason it currently does not do this, and I have multiple users with the same doc open. I'm concerned that changes will get over-written when 2 people are saving their changes. Can anyone help me with the settings for this.

I have an excel form, I want my users to be able to open the form, fill in appropriate data, then click the save button. When the button is clicked, the data in the form should be saved to a new file and then the original form should be reset (clear all values) for a new set of data entry. When the data is saved, I want the new excel sheet to be saved to a location specified within the macro so the user doesn't have any options and I want the title of the new file to be the value of one of the cells.

I'm new to macros and would appreciate any help this board can offer. Thanks...

Hi all,

I've been getting this error on occasion recently.

- It's a shared document
- There is usually 10-12 people using the file at the same time

I've read on the Microsoft Help site that the issue is that somebody is accessing the file while another is trying to open it.

Is there a way, perhaps through VBA, that I can not allow a user to save while somebody else is opening the document? Other suggestions on how to avoid this error?


We have an Excel spreadsheet that sits on the network.
People need to open the file to be able to sign up for various duty rosters.
We would like for the file to open for the first person.
And then for any others after that, get a message that the file is in use
WITHOUT the option to open a read-only copy.
Our staff can't read and they keep opening additional copies of the file!
I have read about sharing the file and I don't think that would make things
any better.

I get the error message "reference is not valid" each time I open my spreadsheet. I get this message three times, and once I am done clicking ok on all three of them, my spreadsheet works just fine. The problem is, I have to send it to a bunch people.

I have a sheet with raw data a sheet with pivot tables a sheet with a dashboard and a simple macro
I don't have any #REF cells either.

Someone has any idea of what could be the problem?



I'm having a problem in a workbook with several ActiveX command buttons. I had been using the form control buttons to run macros, but the boss wanted each button to have it's own, different color. So I removed the form control buttons and created new ActiveX command buttons. I got into the button properties and set the background colors. I added the _Click code to run the macros when the user clicked the buttons.

All of the buttons were working fine. Then I saved and closed the workbook and went to lunch. Now when I open the workbook, the buttons don't work! When I click them nothing happens. They appear frozen. They don't even seem to click. No error message. Nothing.

If I right-click the button in Design Mode and select Properties, I get sheet properties not the button properties. I can't seem to locate the command button properties any longer. I still see the button name "cmdButtonGetInfo" and "=EMBED("Forms.CommandButton.1","") in the name box and formula bar. The odd thing is if I create a new button it works fine until I save and close the file. When I reopen the file none of the buttons work.

It's like the buttons are being disabled when I close or open the file. Any suggestions?

I need the necessity do delete a sequence of sheets in my workbook.
If I use this code:

With ActiveWorkbook
If .Worksheets.Count >= 5 Then
For n = 5 To .Worksheets.Count
Next n
End If
End With

I receive a confirmation message box with this message:

"Data may exist in the sheet(s) selected for deletion. To permanently delete the data, press Delete" [DELETE] [CANCEL]

I wish to delete all sheets without receiving any message.

Is it possible?

Many thanks in advance for your kind support.



I did a bit of browsing on this problem. Found others suffering the same but haven't found any conclusive answer yet.

Every so often when I attempt to save a file, (including save as), Excel won'r let me. By won't let me I mean:

using Save doesn't appear to do anything using Save As doesn't either do anything, the dialog is not displayed and if I am doing via the File menu then the File menu is exited and the previous ribbon tab is displayed (i.ethe one I was on before clicking 'File') if I close the workbook I am prompted to save, close without saving or cancel. Clicking save just invokes the same msgbox again. I can't work out when it goes into this mode. Some days I can work without this problem, other days I encounter this 2 or 3 times.

The only thing I could suspect was I think this started around about the time I installed xlDennis' code library. I have uninstalled the addin and so far so good, but I cannot categorically say that this was the cause.

Anyone have any idea?


Edit: I have read this: / /> Doesn't seem to cover the issue I describe

Thnx for your help man. Now I have another situation.

I have the following:

1. Login form containing username and password fields.
2. Data entry form

I want to do the following:

1. Coding for username and password fields, which, If the login is successful, takes me to DATA Entry Form, Otherwise shows message "Invalid Login".

Thanks in anticipation.

Hi all,

I've had a long search through your pages to see if this question has been answered before but having browsed through about 50 pages worth of threads I couldn't see anything, but if I am repeating prior information I do apologise.

I've written a macro that is relatively simple. It just takes some information in one format, rearranges it, adds some formatting and performs some calculations. Nothing incredibly fancy but it works fine on my computer.

Now, I need to share this macro with some other people, so basically I've just sent that excel file on to the people that need to use it. Should be fine and in most cases it is, however there is one user who although they can open the file, can't seem to get the macro to run properly.

It seems to get a small way through the macro but then stop with no error messages or any sign that it hasn't completed properly.

I have checked Macro Security level and that is the same as mine, Tools - Add-Ins is the same, In Visual Basic, Tools - References is the same as mine. It is the same Operating system and the same version of Excel.

I have even signed into this person's computer as myself (it's a big company network thing) and tried to run the macro and it works fine, so there is nothing wrong with the hardware.

I've googled and searched and tried everything I can think of but I'm no closer to solving this problem, so if anyone has read through this wall of text and can come up with a possible solution, that would be greatly appreciated to save me from tearing ALL my hair out!

Thanks very much for your time.

I'm trying to open a pdf file from within excel vba. I have tried using the followhyperlink method but adobe acrobat opens very briefly then immediately closes Code:

Sub OpenPDF()
'Dim pdf As String
 On Error Resume Next
 'pdf file to open
 pdf = "K:\PDF\mypdf.pdf"
 'open the pdf file
 ActiveWorkbook.FollowHyperlink pdf
End Sub

So then I tried to create an instance of acrobat by setting a reference to the acrobat object but I can't get this to work either!

The code I'm using is Code:

Sub OpenPDF()
 Dim pdf As AcroPDDoc
 Dim strPDF As String
 Set pdf = CreateObject("AcroExch.PDDoc")
 'pdf file to open
 strPDF = "K:\PDF\mypdf.pdf"
 'open the pdf file
 pdf.Open strPDF
End Sub

Any ideas what could be wrong with either approach?


I've lost my menu bar in Excel. I tried to enable Worksheet Menu bar, but
that is not even listed in my toolbar section in the Customize box. Any
other ideas?

Hi all

I've code some VBA code which produces an output file from a template.
Now, if I want to run the output more than once, I get an message asking if I want to overwrite the existing file (which I always do).

I've tried turning off displayalerts but it's not working.
Is there any way of turning this message off?


i've got the following problem:

I want users to double-click on a row on a protected sheet and then do some code based on the row-number of the clicked cell. I've protected the sheet because it contains a lot of formula's.

When a user double-clicks a row it triggers the code through the Workbook_SheetBeforeDoubleClick event.
After the code is executed Excel shows a message that the cell that was clicked was protected etc etc.

How can I prevent this message from popping up?

I've already tried

application.displaywarnings = false

but that didn't work



I have written a macro and at the end it displays a message "The macro has finished".

I would like this message box to disappear after 2 seconds automatically so that users don't have to press the OK button all the time.

can this happen ?


Can I create a message box that displays a message when the spreadsheet is first opened?

If so, where do I put it?

Thought I'd append my experience of the above problem - you can find all sorts of references to it everywhere.

My problem was that a userform defined with Excel at work (containing DT pickers) gave the message in the title when opening it at home. I had a light-bulb moment and wondered whether there was a difference in the version numbers for MSCOMCT2.OCX at work and at home. Turned out the work version was newer. I then copied the MSCOMCT2.* files from work, made a backup of them at home and copied those from work to my C-drive (Windows XP - c:\windows\system32\ ).

No luck. I then rebooted the machine - still no luck.
Then, finally I unregistered the old DLL via

regsvr32 /u c:\windows\system32\MSCOMCT2.OCX

(not sure if this was necessary, but I didn't think it could hurt). Reregistered the DLL via

regsvr32 c:\windows\system32\MSCOMCT2.OCX

and what do you know - it worked.

Summa summarum - it could be an idea to check whether the two machines have different version numbers for the MSCOMCT2.OCX files.


I have a number of different files that I often need to run a macro on. In order for me to do it on the 75-100 files I have at any given time, I need to open one, run the macro, close and save, then open the next one.

Is it possible to write a macro that will start with the first file in a folder, open it and update links, run a macro, save and close, and open the next file in the folder until it has open all the files in the folder.

I have experience with creating macros that reference different workbooks, but not sure how to go about opening files with different filenames (without referencing the exact filename).

I'd like to be able to have basic code for opening, saving and closing, opening next file, saving and closing, etc. and input the macro I'd need to run in each file in the appropriate location. Is this possible? Any help is greatly appreciated!!



My Cell C3 is a numeric value.....I have set conditional formatting to
make the text red and bold when the number is equal or less than 10,000
is there a way I can make cell E3 display a message when the C3
condition is true?? or if not a message is there a way to make a
message box pop up when my C3 condition of less then or equal to 10,000
is true?

how would I do something like this?

I have a large spreadsheet in Excel 2007. I am converting it to a .csv file to import in to another program. I need to delete all commas from all data.

When I try to replace all commas (with nothing or with another character), I get the error message "The formula you typed contains an error."

I have tried various formats (text, general, etc.) and various file types (.xls,.xlsx, .csv) and still get the same error.

Is there an on error exit sub command. I would like my Macro to just stop running if there is an error instead of an error message popping up. Thanks in advance

We have a number of Excel users in our office who cannot copy and paste
between Excel workbooks. They can copy and paste between worksheets. When
you highlight the section to copy and then go to the new workbook both the
and paste special are "grayed out". This is true whether you right-click the
mouse, go to the edit menu, or use control keys. This occurs with any data
type and the most simple workbooks. I have seen some suggestions here but
none have worked for this particular problem. I have reset the menus and
renamed the .xlb files and neither helps. You can open the clipboard and the
paste will work, but there is no paste special option. Any help would be
greatly appreciated. Thanks!

I have an Excel workbook that was created by a former coworker. It includes a macro that, among other things, displays a message box about the 2008 file. The macro runs as soon as the file is opened. I'd like to access that macro to correct the date to 2011 and see what else, if anything, it's doing for me (it doesn't appear to do much). I can find references to creating macros to hide and unhide rows/columns and I found ways to delete all macros in a workbook, but I cannot find anything about unhiding a macro without knowing its name.

Does anyone know of a way to unhide this macro?



I'm pretty new at VBA and was wondering if you could help me out on this:

I have created a VBA userform but will need to have it used by at least 5 users. My question is, can it be done with all users working at the same time and when saving their work all data entered will go to one master excel sheet? if yes, would you be kind enough to share the code?
MS Access is not an option for me so I was wondering if you could help me do this in excel.

thank you so much and would really appreciate to hear from anyone soon.

I have a simple address book spreadsheet. I would like to create a Search
form, where the user can enter the Last Name of the person they are searching

Related pages

occupancy percentage formula in hotelssharepoint vbaleaveplannerexcel formula to find duplicatest shirt inventory spreadsheet templateexcel analysis toolpak tutorialexcel create named rangergb excelinsert signature excelforty five lakhs in numbersbroken axis excelhow to decrease decimal in excelmerge and center shortcutexcel mortgage payment formulamsgbox input vbafedex tracking numbers formatexcel macro free workbookformula for calculating productivitysscc 18 check digit calculatora squared symbolrange reference vbahow to delete data validation in exceldivide numbers in excelunprotect excel 2010 workbookmsg 8152 in sql serverpaypalfeecalculatorexcel formula weeksheet name excel formulahow to merge to rows in excelovertime calculator californiacheckbook ledger templatefind circular references in excelsurface chart excelexcel named range changehow to calculate holiday entitlementpalletization calculatorhow can i hide columns in excelconcatenate formula in excel 2007cannot locate specified ole object within the documentrename excel worksheetcost per unit excel templateusing excel c6 manualexcel worksheet separatortrailing 12 months calculationcompounded interest formula excel3d interpolation excelexcel filter vbavalue of a perpetuity formulaexcel tab name in cellexcel insert calendarhow to remove shading in excelvisio vbarun time error 481excel formula to count charactersexcel distribution curvecell color in vbaresource utilization spreadsheetweighted avg in excelheatmap in excelblank pie graphcorrel functionsalary increment formatexcel match multiple columnsexcel barcode formulaslope formula in excelshortcut key for redo in excelruntime error 1004 excel macroshortcut key for pivot table in excel 20071099 excel templateexcel secondary axisexcel mergecellsmicrosoft query syntaxvba directoryspeedometer chart in excelsubscript out of range accessexcel fill handle not workingconvert absolute humidity to relative humidity