Problems running an Access dbase on Parallel Desktop for Mac

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Cooper
    New Member
    • Jul 2010
    • 44

    Problems running an Access dbase on Parallel Desktop for Mac

    Hello, I have developed and tested an Access database that I now wish to distribute. It works well on all computers tested, including an Apple Mac running Parallels Desktop, but with one exception. When using the Mac, on the command to open an existing PDF it fails to deliver, with no error message. The VBA I am using to do this is as follows:

    Code:
    Private Sub Form_DblClick(Cancel As Integer)
    On Error GoTo 10
    Dim strFile As String
    Dim lngErr As Long  
    strFile = "C:\Wheelbase\Invoices\" & Me!Account & "-" & Me![Inv No] & ".pdf" 
    lngErr = ShellExecute(0, "OPEN", strFile, "", "", 0) 
    10
    End Sub
    and

    Code:
    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, ByVal ShowCmd As Long) As Long
    It works fine with Windows. Is there a compatibility problem with 'Parallels' on the Mac?

    Thanks
    Nick
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Which version of Access are you running on the Mac?
    Which version of the emulation OS are you running on the Mac?
    -z

    Comment

    • Nick Cooper
      New Member
      • Jul 2010
      • 44

      #3
      The Mac is running Access 2007 and it is using Version 7 of the Parallels Desktop OS.
      Nick

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        Shell opening as hidden or Bodged file associations.

        Sorry to take so long to get back to you.
        The family was on vacation and I'm only just now really getting things back on track... work tomorrow and more things to get back in order there :)

        HOWEVER!

        Talked with a Mac friend... he mentions that sometimes the file associations can be bodged in Parrallels and is the very first thing to check... easy enough:
        Can you open other pdf files directly in Acrobat on the Mac in question?

        If so then try modifing line 6 as I believe that you are telling the application to hide the window upon open:
        Code:
        ShellExecute(0, "OPEN", strFile, "", "", 3)
        ( http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx )

        If you can not open pdfs directly then you'll need to resolve that issue first and that is well outside of this thread; there are however some really good Mac forums that should help in this case.

        -z

        Comment

        • Nick Cooper
          New Member
          • Jul 2010
          • 44

          #5
          Thanks for that and no probs about the delay. Yes, PDFs do open from Windows Explorer, but not when accessed via the ShellExecute command from within Access. Sadly that is still the case when I replace the 0 by a 3 in the 6th line of code, as suggested. I confess to not being an expert on the coding, having pasted it in from a previous interchange with 'Bytes', but it has worked flawlessly for 2 years now, on a number of XP and Windows7 OS computers. Any other thoughts please?
          Nick

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            Haven't missed you... just back from vacation and lots to catch up on.
            I'll ask my Mac friends about this... may take a tad to get an answer back as they live way across the country.
            -z

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              Well that was fast....
              My buddy says that you should start at the beginning of this thread to get a background on the issue, and of note is post #130 on page 7... I think he deals with this alot:
              Windows File Associations - Not Updating with Newly Installed Windows Apps I have read through many posts on similair problems. However, the issue I...

              SO, it appears that this may be a VM issue which is so beyond what I can help you with ( honestly... I don't know enough about the parallels environment to be much if any help if the issue lies there-within )
              -z

              Comment

              • Nick Cooper
                New Member
                • Jul 2010
                • 44

                #8
                Well I guess that makes two of us! Post #123 in your link seems to offer a solution which I might try, but you can't really distribute a database along with some complicated instructions to make it work properly on some machines. It looks like I will have to reduce the functionality to ensure compatibility across the board. Shame.
                Thanks for your guidance!
                Nick

                Comment

                • Nick Cooper
                  New Member
                  • Jul 2010
                  • 44

                  #9
                  Maybe there is another way I can get round this problem. The reason for the above code was to ensure that a PDF could be created without having to bother about the Adobe version number being updated. Originally I used the following code, but it was messy as it would require the user to update the path every time the version changed:
                  Code:
                  Private Sub Form_DblClick(Cancel As Integer)
                  Dim strProg As String
                  Dim strFile As String
                  strProg = "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"
                  strFile = "C:\Wheelbase\Invoices\" & Me!Account & "-" & Me![Inv No] & ".pdf"
                  Call Shell(strProg & " " & strFile, vbMaximizedFocus)
                  End Sub
                  Is it possible to use a wildcard in the \Reader 10.0\ directory so it would be independent of whatever version number was running? I have tried using stars '*' but to no avail.
                  Fingers crossed!
                  Nick

                  Comment

                  • zmbd
                    Recognized Expert Moderator Expert
                    • Mar 2012
                    • 5501

                    #10
                    I don't think that you can use the wild-card.

                    As far as I know, from the code you've posted, you will have to determine which version is installed and then build the string.

                    This will be a tad out of my normal as once again I don't know how your VM works.

                    I would suggest going back to the forum in the link I posted in #7 and posting the question there too... someone with more Mac/Paralles may very well have this solved on their site.

                    -z

                    Comment

                    • Nick Cooper
                      New Member
                      • Jul 2010
                      • 44

                      #11
                      Sorry Z, I didn't make myself clear. My last question didn't relate to the Mac/Parallels problem. The code I just sent works fine on MS or Mac/Parallels computers and using it gets me round the previously discussed compatibility issue. It's just that I need to make strProg resilient to changes in the Adobe version number in the 3rd directory.

                      However, from what you've said, it seems this can't be done by using a 'wild card' in the stricg so it's back to the drawing board I fear!
                      Thanks
                      Nick

                      Comment

                      • Nick Cooper
                        New Member
                        • Jul 2010
                        • 44

                        #12
                        Hi Z, As a postscript to the above, in the absence of the ability to use wild-cards in directory strings, I have found a solution that does not need to use the ShellExecute command and is therefore resilient to the Mac/Parallels problem, but also handles older Adobe versions as well as future updates.
                        There are three variables along the path to the executable:
                        'Program Files' with or without the subscript (x86)
                        'Acrobat' or 'Reader'
                        and then the Version Number that follows that.
                        The VBA routine keeps trying all of these, including version numbers from 00.0 to 99.0 until the error trapping lets it through. It then saves that route on the database to speed up the routine for next time. On version upgrade it will get an error and just go through the process again. Sledgehammer to crack an annoying nut but it works! Happy to pass on the code if anyone else is interested.
                        Cheers
                        Nick

                        Comment

                        • zmbd
                          Recognized Expert Moderator Expert
                          • Mar 2012
                          • 5501

                          #13
                          I'm wondering if something like the following would be usefull... http://www.ammara.com/access_image_f...er_search.html
                          I've been playing with it, using various paths and wildcards and it might be possible to modify the results.

                          -z

                          Comment

                          Working...