LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run certain macros based on operating system

Dave:
I believe I got the code to e-mail without a client from Ron's
site. My preference is to do it without a client, which may come back
to bite me.
Thanks again for your help.



On Fri, 28 Jul 2006 13:56:01 -0500, Dave Peterson
wrote:

Couldn't you just look at the first xx characters:

if lcase(left(application.operatingsystem,19)) _
= lcase("Windows (32-bit) NT") then

or

if lcase(application.operatingsystem) like lcase("Windows (32-bit) NT*") then
...

===========
Ron de Bruin has a bunch of notes about emailing via code:
http://www.rondebruin.nl/sendmail.htm

I think he uses CDO (I've never used it) to overcome some problems with
different versions of Outlook.

"Mr. Smith" wrote:

Dave:
Thanks. I'll give it a whirl.
One other question: Is there a way for the macro to just look
at "Windows (32-bit) NT 5" and "Windows (32-bit) NT 4" portion to
determine if it's an XP or NT machine? (I want to be sure it will run
whether it's 5.01 or 5.02, etc.)
Where I work, we have a mix of NT4 machines that should be in
a Dumpster and XP Pro workstations. Because people jump around, they'd
need this workbook to work wherever they are.
Specifically, the workbook with the macros does its thing then
e-mails the resulting workbook. With XP, I have a macro that calls the
mail server (bypassing the need for an e-mail client) and will
silently send the workbook. This is the way I'd prefer, but on NT, it
doesn't work. I have another macro that does, which uses Outlook to
mail the file. The macro that works on NT, doesn't work on XP, and
vice versa.
I'm sure there are easier ways to do this stuff but I'm not
savvy with Excel.
Thanks again for the help.

On Thu, 27 Jul 2006 16:27:37 -0500, Dave Peterson
wrote:

if lcase(Application.OperatingSystem) = lcase("Windows (32-bit) NT 5.01") then
'do xp stuff
else
'do non-xp stuff
end if

Just curious -- what will you be using that depends on the operating system
version?

"Mr. Smith" wrote:

I need a workbook with macros that need to run on machines
with older versions of Windows NT 4 and others on Windows XP
Professional.
Instead of making two separate workbooks, I'd like an IF-THEN
scenario using the =INFO("osversion") formula to determine the
operating system and if it's not XP -- I get "Windows (32-bit) NT
5.01" with the osversion formula on the XP machines -- to run the
NT-compatible macro.
But, being a newbie, I don't know how to go about that.
I Googled for an example, but came up empty. I would have to
imagine someone else has come across this problem before.
Thanks for any help/pointers, etc.




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting the Date Format Being Used By The Operating System And Exc Sunnous Excel Programming 1 November 17th 05 12:33 PM
Find out Operating System Mohan[_2_] Excel Programming 5 January 16th 04 08:36 PM
mail program & operating system steve Excel Programming 2 September 23rd 03 10:26 PM
Operating system Don Guillett[_4_] Excel Programming 0 September 10th 03 04:43 PM
Operating system Stephan Kassanke Excel Programming 0 September 10th 03 04:42 PM


All times are GMT +1. The time now is 06:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"