+ Reply to Thread
Results 1 to 4 of 4

(VBA CODE) being told file is READ ONLY but is not the case

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    18

    (VBA CODE) being told file is READ ONLY but is not the case

    afternoon all

    i have a simple part of my VBA code below

    the rest of the code opens / closes various workbooks and moves data around

    for the below workbook i can only let 1 user in at a time and the code was working great until today
    (i made lots of changes to the macro but on the specific code below i moved the destination of the target file to a shared drive)

    i now get the error message box...
    MsgBox "A Colleague On your Team is saving there data. Please wait 5 seconds and try again"

    but the file is 100% not in use by someone else
    the password is correct
    the file name / destination is correct
    i have tried moving back to the old drive aswell

    could anything else be making my macro believe this file is read only???
    or can anyone else see an error in there ???

    thanks in advance

    mike




    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    06-12-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: (VBA CODE) being told file is READ ONLY but is not the case

    ok when i personally run the macro its fine

    when my colleages run it it gives the error MsgBox

    i asked my colleagus to go into the drive to see if they have access and the file opens fine for them!!!

    but on the macro it doesnt ??????????????
    aaaaahhhhhhhhhhhh!!!!!

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: (VBA CODE) being told file is READ ONLY but is not the case

    Is S:\Auth Model\FLT EXPORT MASTER.xls set as read only?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  4. #4
    Registered User
    Join Date
    06-12-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: (VBA CODE) being told file is READ ONLY but is not the case

    Facepalm

    I.T had restricted access to that folder for people working in our bristol office !!!!

    so thats why it was working in London testing but not when giving to bristol office

    again double facepalm

    on another note if your reading this post youve probably got a similer problem so here is another way of doing the same thing

    ' Open Invoice File
    MyInvoiceFile = "W:\USERS\INVOICE #2002.xls"
    Set MyWorkBook = Workbooks.Open(MyInvoiceFile)

    ' Check to see if file is already open
    If MyWorkBook.ReadOnly Then
    ActiveWorkbook.Close
    MsgBox "Cannot update Invoice Log, someone currently using file. Please try again later."
    Exit Sub
    End If



    or if you want to see if user already has a file open and thus prevent re opening



    On Error Resume Next
    Workbooks("FILENAME HERE.xls").Activate
    If Err <> 0 Then Err.Clear: Workbooks.Open ("DRIVE\FOLDER\FILENAME HERE.xls")



    bests

    mike

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Read-only file on server. How many people can read at once?
    By Xx7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 12:10 AM
  2. [SOLVED] Disregard case in VBA code. (UCase, LCase, Select Case)
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-07-2012, 12:12 PM
  3. ASP Code to read excel file
    By fcomino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2011, 09:32 PM
  4. Can Column Offset in VB code be told to go to column A?
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2009, 03:05 PM
  5. [SOLVED] How can a file be converted from Read-Only to Read/Write
    By Jim in Apopka in forum Excel General
    Replies: 2
    Last Post: 11-19-2005, 01:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1