+ Reply to Thread
Results 1 to 3 of 3

Why do i get Sub or Function not defined on If IsFileOpen?

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    sweden
    MS-Off Ver
    15.0.4569.1506
    Posts
    3

    Why do i get Sub or Function not defined on If IsFileOpen?

    I have tested changing The code to Sub TestFileOpened()

    ' Test to see if the file is open.
    If IsFileOpen("c:\Book2.xls") Then


    MsgBox "File already in use!"


    Else

    MsgBox "File not in use!"

    Workbooks.Open "c:\Book2.xls"



    End If

    End Sub


    This is a genera code that i found on http://support2.microsoft.com/kb/291295

    And i have changed it from the exampelfile to an existing file on my computer.
    i also tried changeing the If isFileOpen function to If IsWorkBookOpen.

    But no luck


    I have version 15 don't know if the code should be formulated in a different way from exampel i got and that why or if im simply stupid.
    I got it working yesterday but after that the computer froze and i hade to restart and now it wont work.

    I also have problem finding new macros in the list aldo its save within the worksheet it wont pop up, any clues?

    Please help.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Why do i get Sub or Function not defined on If IsFileOpen?

    Try this instead

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Why do i get Sub or Function not defined on If IsFileOpen?

    isFileOpen is not an Excel function, the code you found also included the function definition.

    Please Login or Register  to view this content.

+ 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. [SOLVED] User defined function returns an error on a standard function used in it.
    By pb48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 01:35 PM
  2. [SOLVED] Run Time 1004 - App Defined or Object defined error with String defined path structure
    By sarails in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2012, 09:38 PM
  3. Application Defined or Object Defined Error, Command Button and Vlookup Function
    By stevedomer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-14-2011, 11:20 PM
  4. IsFileOpen function not working correctly
    By rjtools in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2008, 01:42 PM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 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