Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-01-2014, 05:31 AM
Charles Kenyon Charles Kenyon is offline Macro to determine if word or excel application is being used Windows 7 64bit Macro to determine if word or excel application is being used Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,536
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Code:
Sub whichApp()
  dim sApp as String
  sApp = Application.Name
  msgBox "Application is " & sApp
End Sub
Have a test for the value of sApp. It will be either "Microsoft Word" or "Microsoft Excel." Or, you could pass sApp as a parameter to your called procedure.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to determine if word or excel application is being used application wide macro ronaldo.k PowerPoint 1 11-21-2013 11:31 AM
Macro to determine if word or excel application is being used cannot start the source application for this object - Excel charlesmac Excel 3 08-15-2012 05:22 AM
Macro to determine if word or excel application is being used A word macro application Hikmetotheron Word 3 04-26-2011 02:01 PM
Macro to determine attached template zippyaus Word VBA 0 03-02-2010 02:05 AM
Excel 2003 will not terminate with application.quit Peter Schellenbach Excel 12 03-14-2006 05:28 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft