Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Workbooks.open fails (XL 2007 (64bit via citrix))

    I'm trying out an XL2000 macro under XL 2007. It chokes with:
    <pre>Run-time error '445':
    Object doesn't support this action</pre>


    On clicking 'Debug' the offending line of code is highlighted thus:
    <pre>Dim fStats As Variant
    Dim wsStats As Workbook

    Do
    fStats = Application.GetOpenFilename("(*.xls), *.*", , "Select the stats workbook to open:")
    Loop Until fStats <> False

    <span style="background-color: #FFFF00; color: #000000; font-weight: bold">Workbooks.Open Filename:=fStats</span hi>

    Set wsStats = ActiveWorkbook</pre>


    I don't understand, what's wrong with the Workbooks.Open line?

    stuck

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workbooks.open fails (XL 2007 (64bit via citrix))

    What does fstats contain when the line fails? You don't test for an empty string, maybe that is the culprit?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workbooks.open fails (XL 2007 (64bit via citrix))

    It contains the expected full path and filename of the .xls I'm trying to open...

    but..(a possible light begins to dawn as I type) if the .xls contains some code that XL 2007 doesn't like when the file opens (and it may well do, I need to check that), then this particular code will stall.

    I'll edit this post when I've checked out the workbook I'm trying to open more closely.

    Ken

    EDIT: the problem is not with this code, it is because workbook I'm trying to open throws up an error, related to a custom toolbar. I'll start a new thread about that issue if I get stuck with it.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Workbooks.open fails (XL 2007 (64bit via citrix))

    Two tips:

    1. Add

    Application.EnableEvents=False
    before the .Open statement and
    Application.EnableEvents=True
    afterwards

    2. Check http://www.jkp-ads.com/articles/workbookopenbug.asp
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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