+ Reply to Thread
Results 1 to 5 of 5

OpenFileName = Application.GetOpenFilename Crashing Excel 2016 (64bit)

  1. #1
    Registered User
    Join Date
    09-06-2017
    Location
    ENGLAND
    MS-Off Ver
    MS OFFICE 2016 (64)
    Posts
    2

    OpenFileName = Application.GetOpenFilename Crashing Excel 2016 (64bit)

    Hi,

    We have a customer that is running Excel 2016 64bit (yeah, I know, 64bit is not recommended but they have to have it for a specific system they are running so I can't just uninstall and install 32bit).

    They have a spreadsheet with macros that has been running perfectly for months and now is suddenly crashing Excel on execution. I presume this is due to an update to Office or possibly VB.

    At this point I should point out that I did not program this, it was written by a third party that the customer used direct and is no longer available... sigh.

    By debugging the code I can see that is this section that crashes excel. The red line being the exact line that knocks it over.

    Function OpenWorkbook() As Workbook
    OpenFileName = Application.GetOpenFilename("Commission Spreadsheet,.xls; .csv; xlsm")
    If OpenFileName = "False" Then Exit Function
    Set OpenWorkbook = Workbooks.Open(OpenFileName) 'Get data
    End Function

    The crash details are the usual help.

    Problem signature:
    Problem Event Name: APPCRASH
    Application Name: EXCEL.EXE
    Application Version: 16.0.8326.2096
    Application Timestamp: 59a4b539
    Fault Module Name: EXCEL.EXE
    Fault Module Version: 16.0.8326.2096
    Fault Module Timestamp: 59a4b539
    Exception Code: c0000005
    Exception Offset: 000000000000f4c1
    OS Version: 6.3.9600.2.0.0.16.7
    Locale ID: 2057
    Additional Information 1: 6a67
    Additional Information 2: 6a674c7f3fabe4c0e6f373aa32e1c003
    Additional Information 3: f11d
    Additional Information 4: f11da28a6897dbe58e97a75b0c4e7512

    Any suggestions would be very much appreciated.

  2. #2
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: OpenFileName = Application.GetOpenFilename Crashing Excel 2016 (64bit)

    Removed bad/wrong information
    Last edited by meabrams; 09-06-2017 at 06:35 AM. Reason: Bad information
    Bramz

  3. #3
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: OpenFileName = Application.GetOpenFilename Crashing Excel 2016 (64bit)

    @meabrams,

    Application.GetOpenFilename is not an API call.

    @JamieF4T

    Does the application crash when the code tries to launch the open file dialog, or when you press OK/Cancel on it?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  4. #4
    Registered User
    Join Date
    09-06-2017
    Location
    ENGLAND
    MS-Off Ver
    MS OFFICE 2016 (64)
    Posts
    2

    Re: OpenFileName = Application.GetOpenFilename Crashing Excel 2016 (64bit)

    Without the ("Commission Spreadsheet,.xls; .csv; xlsm") bit amended on the end it starts up the browse for file window and all works fine.

    As it happens, the customer is now happy that its all working now that I have removed that bit and its doing what it should so I'm not really sure what that bit was used for?!

    With that in, it crashes before the browse for file window ever appears.

    Oh well, they are happy its working as they need it without that bit so not to worry!

    Thanks for your help Bram

  5. #5
    Registered User
    Join Date
    10-05-2017
    Location
    SYDNEY
    MS-Off Ver
    Office365 ProPlus
    Posts
    1

    Re: OpenFileName = Application.GetOpenFilename Crashing Excel 2016 (64bit)

    Hi,

    Seems like recent Windows patch update causes excel to crash while executing the application.getopenfilename method. Using Application.FileDialog property instead of Application.GetOpenFileName worked for me.

+ 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. Excel 64bit 2016 Database Connection 32bit...what to do?
    By unclejemima in forum Excel General
    Replies: 1
    Last Post: 03-10-2017, 05:32 PM
  2. [SOLVED] today() in Excel 2010 32 bit vba returns different value than Excel 2016 64bit
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-10-2016, 12:34 PM
  3. Excel files crashing when upgrading to 64bit Excel
    By aciccarelli in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-25-2015, 04:24 PM
  4. How to read custom props on closed file (64bit Win Server, 64bit Excel)
    By soundneedle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2015, 01:25 AM
  5. [SOLVED] Obscure VBA error? Application.Run conflicts with Application.GetOpenFileName
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-15-2013, 08:31 PM
  6. Replies: 3
    Last Post: 11-23-2012, 01:57 AM
  7. [SOLVED] [SOLVED] Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen)
    By Paul Martin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-05-2005, 12: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