Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204

    Hi Steve
    Ah, I remember when I was only your age.... well vaguely anyway!
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  2. #17
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    Nice to know that compared to you guys, I'm the baby.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #18
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,879
    I'm on the opposite end of the 50's from Colin which also puts us at the opposite ends of the 60's.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #19
    riktek is offline Novice
    Windows 10 Access 2019
    Join Date
    Jun 2025
    Posts
    1
    Late to the party but I stumbled across this and wanted to comment a few tweaks to Colin's revisions to the Dev Ashish fHandleFile() necessary to run it on 64-bit Access.

    First, revise the apiShellExecute #VBA7 declaration to:

    Code:
    Declare PtrSafe Function apiShellExecute Lib "shell32.dll" _
                                            Alias "ShellExecuteA" _
                                            (ByVal hwnd As LongPtr, _
                                            ByVal lpOperation As String, _
                                            ByVal lpFile As String, _
                                            ByVal lpParameters As String, _
                                            ByVal lpDirectory As String, _
                                            ByVal nShowCmd As Long) As LongPtr
    This requires altering the declaration of the variable holding the ShellExecuteA() return value:

    Code:
        #If VBA7 Then
            Dim lngReturn As LongPtr
        #Else
            Dim lngReturn As Long
        #End If
    Also, the Window constants got changed from the original. The correct ones are:

    Code:
    Public Const WIN_NORMAL = 1         'Open Normal
    Public Const WIN_MAX = 3            'Open Maximized
    Public Const WIN_MIN = 2            'Open Minimized
    Unrelated to how it works, the function doesn't exploit these, passes identical values to both ShellExecuteA() and Shell(), and those functions' constants are identical in this range, so my implementation skips those declarations entirely. This necessitates a slight revision of the Shell() call:

    Code:
    varTaskID = Shell("rundll32.exe shell32.dll,OpenAs_RunDLL " & sFile, lShowHow)
    I also altered the signature to make the lShowHow parameter optional and default it to 1 (normal), to simplify the call in most instances:

    Code:
    Function fHandleFile(sFile As String, Optional lShowHow As Long = 1) As Variant
    I also tweaked the construction of the return value to yield something CBool() could consume:

    Code:
    fHandleFile = lReturn & IIf((LenB(sReturn) = 0), Null, ", " & sReturn)
    HTH

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Turn of security warning in Access
    By jaryszek in forum Access
    Replies: 5
    Last Post: 07-30-2018, 03:13 PM
  2. Replies: 4
    Last Post: 08-14-2017, 11:52 AM
  3. Replies: 4
    Last Post: 05-19-2015, 09:04 AM
  4. Pop-up Concern
    By ccchan in forum Forms
    Replies: 1
    Last Post: 03-12-2014, 10:47 PM
  5. Replies: 1
    Last Post: 02-27-2011, 06:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums