+ Reply to Thread
Results 1 to 2 of 2

Test if Excel has a file open

  1. #1
    Forum Contributor
    Join Date
    08-23-2010
    Location
    Staten Island, NY
    MS-Off Ver
    Excel 2003
    Posts
    242

    Test if Excel has a file open

    I have some code that will run if someone hits a button. The issue is it will work correctly no matter what file someone has open in Excel, even if it is blank. However, if someone hits the button and no workbook is open then it crashes. Can I test to make sure that a(any) workbook is open?

    Here is a screen shot to give people an idea of what I want to testExcel.jpg

    As you can see Excel is open but there is no Workbook open. I want to test to make sure any workbook is open.

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Test if Excel has a file open

    Please Login or Register  to view this content.
    but then again, workbooks count is always >0 since personal.xls counts as one.
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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