Translation of VBA from PC to MAC

A

alina b.

Hello,

I have the following code in my PC version that works without error,
could someone tell me how to modify it so that I can have it open in a
MAC version?

pathname = ActiveWorkbook.Path
Databasaefile = pathname & "\Database.XLS"
Workbooks.Open Filename:=Databasefile

Basically, for the third line it gives me a Run-time error. I believe
it doesn't recognize the pathname.

Thanks,
alina b.
 
M

Mike Middleton

alina b. -

If you don't get any assistance here, I suggest you post in the following
newsgroup:

microsoft.public.mac.office.excel

And, you could use the advanced search feature of Google Groups to see if
there are past newsgroup messages on this topic.

- Mike
www.mikemiddleton.com
 
A

alina b.

Thank you Mike

Mike said:
alina b. -

If you don't get any assistance here, I suggest you post in the following
newsgroup:

microsoft.public.mac.office.excel

And, you could use the advanced search feature of Google Groups to see if
there are past newsgroup messages on this topic.

- Mike
www.mikemiddleton.com
 
K

KR

It seems to me that there is something related to the path seperator - I
believe Mac handles it differently, e.g. I think you can't use "\" in your
path, but I don't have a Mac so I can't be positive. There should be some
variable (which I thought was pathSeparator, but I can't find that in the
Excel help file) that you can use so it will select the correct path
seperator regardless of platform.
 
J

Jake Marx

Hi KR,
It seems to me that there is something related to the path seperator
- I believe Mac handles it differently, e.g. I think you can't use
"\" in your path, but I don't have a Mac so I can't be positive.
There should be some variable (which I thought was pathSeparator, but
I can't find that in the Excel help file) that you can use so it will
select the correct path seperator regardless of platform.

You're correct - Application.PathSeparator should be used instead of
hardcoding the "\" character. I'm not sure if that's the only problem with
the OP's code running on a Mac, but it should help.

--
Regards,

Jake Marx
www.longhead.com


[please keep replies in the newsgroup - email address unmonitored]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top