Results 1 to 4 of 4

Thread: Is File already Open ?

  1. #1
    Member
    Join Date
    2002-11
    Posts
    48
    Login to Give a bone
    0

    Default Is File already Open ?

    I am wishing.....Is there a methodProperty that tells me if a file is already Open ?

    This is what I have so far which works great...

    'Open Microsoft Excel Invoice Log
    '----------------------------------------------------------------
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Open ("Q:InvoicesAuto-Invoice Log.xls")
    objExcel.Sheets("Sheet1").Select
    Set objExcelSheet = objExcel.ActiveWorkbook.Sheets("Sheet1")

    The only thing I want is the Program to msgbox "File is open" then exit If, infact, the "Auto-Invoice Log.xls is open.

    I am trying to "catch" the error here rather than the Err Handler

    Thank You
    Tim Livingston
    Acad 2004VB6

  2. #2
    I could stop if I wanted to msretenovic's Avatar
    Join Date
    2002-02
    Location
    Galloway, Oh
    Posts
    305
    Login to Give a bone
    0

    Lightbulb Re: Is File already Open ?

    Is this what you are looking for?

    Code:
     
    set wkBook = objExcel.Workbooks.Open("Q:\Invoices\Auto-Invoice Log.xls")
    if wkBook.ReadOnly then 
    	wkBook.close
    end if
    HTH

  3. #3
    Member
    Join Date
    2002-11
    Posts
    48
    Login to Give a bone
    0

    Default Re: Is File already Open ?

    Perfect.

    Thank you.

  4. #4
    Member
    Join Date
    2002-05
    Posts
    47
    Login to Give a bone
    0

    Default Re: Is File already Open ?

    - you can also check this link:

    http://www.markrowlinson.co.uk/exceliswbopen.php

    Best regards
    Claus

Similar Threads

  1. Replies: 3
    Last Post: 2012-06-17, 09:42 PM
  2. Replies: 10
    Last Post: 2007-02-07, 07:43 PM
  3. Open file dialog box does not open
    By johannvonspiralspine in forum AutoCAD General
    Replies: 5
    Last Post: 2006-02-07, 04:28 PM
  4. Lost File/Open File/Save Dialog Box on Autocad 2000i
    By thegoffs.89856 in forum AutoCAD General
    Replies: 3
    Last Post: 2005-06-30, 09:05 PM
  5. open file dialog box slow to open
    By klanier in forum AutoCAD General
    Replies: 2
    Last Post: 2004-09-09, 02:51 PM

Posting Permissions

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