By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,829 Members | 670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,829 IT Pros & Developers. It's quick & easy.

Problems running an Access dbase on Parallel Desktop for Mac

P: 44
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:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_DblClick(Cancel As Integer)
  2. On Error GoTo 10
  3. Dim strFile As String
  4. Dim lngErr As Long  
  5. strFile = "C:\Wheelbase\Invoices\" & Me!Account & "-" & Me![Inv No] & ".pdf" 
  6. lngErr = ShellExecute(0, "OPEN", strFile, "", "", 0) 
  7. 10
  8. End Sub
  9.  
and

Expand|Select|Wrap|Line Numbers
  1. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
  2. ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
  3. ByVal lpParameters As String, ByVal lpDirectory As String, ByVal ShowCmd As Long) As Long
  4.  
It works fine with Windows. Is there a compatibility problem with 'Parallels' on the Mac?

Thanks
Nick
Jul 18 '12 #1
Share this Question
Share on Google+
12 Replies


zmbd
Expert Mod 5K+
P: 5,397
Which version of Access are you running on the Mac?
Which version of the emulation OS are you running on the Mac?
-z
Jul 18 '12 #2

P: 44
The Mac is running Access 2007 and it is using Version 7 of the Parallels Desktop OS.
Nick
Aug 5 '12 #3

zmbd
Expert Mod 5K+
P: 5,397
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:
Expand|Select|Wrap|Line Numbers
  1. 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
Aug 5 '12 #4

P: 44
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
Aug 6 '12 #5

zmbd
Expert Mod 5K+
P: 5,397
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
Aug 6 '12 #6

zmbd
Expert Mod 5K+
P: 5,397
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:
http://forum.parallels.com/showthrea...t=14254&page=7
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
Aug 6 '12 #7

P: 44
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
Aug 7 '12 #8

P: 44
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:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_DblClick(Cancel As Integer)
  2. Dim strProg As String
  3. Dim strFile As String
  4. strProg = "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe"
  5. strFile = "C:\Wheelbase\Invoices\" & Me!Account & "-" & Me![Inv No] & ".pdf"
  6. Call Shell(strProg & " " & strFile, vbMaximizedFocus)
  7. End Sub
  8.  
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
Aug 8 '12 #9

zmbd
Expert Mod 5K+
P: 5,397
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
Aug 8 '12 #10

P: 44
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
Aug 8 '12 #11

P: 44
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
Aug 25 '12 #12

zmbd
Expert Mod 5K+
P: 5,397
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
Aug 27 '12 #13

Post your reply

Sign in to post your reply or Sign up for a free account.