![]() |
How can I know whether an excel sheet is running in a PC or Mac environment?
Hi,
I have some code that runs fine on a PC but trips up a mac. I have found a workaround for the mac, but I need to find a way to shield the code in eaqch case, along the lines of: If [I'm running on a Mac] then mac code Else PC code End if Anyone know how to do this? Thanks in advance. |
How can I know whether an excel sheet is running in a PC or Mac environment?
MsgBox Environ("OS")
Returns 'Windows_NT' on my XP machine, never tried it on a Mac. Thanks! Cliff Edwards |
How can I know whether an excel sheet is running in a PC or Mac environment?
MsgBox Environ("OS")
Returns 'Windows_NT' on my XP machine, never tried it on a Mac. That would be a problem on a Mac using Excel 2008... there is no VBA in that version. This worksheet function can be used to determine the operating system... =INFO("system") It will return either "mac" or "pcdos" as appropriate. Rick Rothstein (MVP - Excel) |
How can I know whether an excel sheet is running in a PC or Mac environment?
On Feb 7, 6:09*pm, "Rick Rothstein"
wrote: MsgBox Environ("OS") Returns 'Windows_NT' on my XP machine, never tried it on a Mac. That would be a problem on a Mac using Excel 2008... there is no VBA in that version. This worksheet function can be used to determine the operating system... =INFO("system") It will return either "mac" or "pcdos" as appropriate. Rick Rothstein (MVP - Excel) Thank you! |
How can I know whether an excel sheet is running in a PC or Mac environment?
Yes, Environ("OS") would be useless if VBA weren't available, but the
OP stated that he had working code for Mac, just needed a way to determine what environment the code was running in to see whether to run pc code or Mac code. Just sayin'. ;) Respectfully, Cliff Edwards |
How can I know whether an excel sheet is running in a PC or Mac environment?
On Mon, 7 Feb 2011 17:09:01 -0800 (PST), ward376
wrote: MsgBox Environ("OS") Returns 'Windows_NT' on my XP machine, never tried it on a Mac. Thanks! Cliff Edwards What would return in a remote session? The OS of the client or the OS of the host? |
How can I know whether an excel sheet is running in a PC or Mac environment?
On Tue, 8 Feb 2011 16:24:02 -0800 (PST), ward376
wrote: Yes, Environ("OS") would be useless if VBA weren't available, but the OP stated that he had working code for Mac, just needed a way to determine what environment the code was running in to see whether to run pc code or Mac code. Just sayin'. ;) Respectfully, Cliff Edwards The fact that there is a requisite of a differential is a problem and breaks programming rules from decades ago. You guys could not make a MAC port that was fully compliant? No, not merely opening of files, but FULLY compliant. No re-do required. Pretty sad the CRAP that Apple has put the world through. Thir crap artificially inflated prices throughout the industry. Jobs is an idiot. His money grubbing will be/IS part of what harms this nation's economy. None of you phone wielding twits will ever see it though, since you are all hard wired with horse blinders on. |
All times are GMT +1. The time now is 02:00 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com