Fun and Extremely Useful Project for a Script Lover

I am thinking about dabbling with PowerShell scripting because I and other business users could really use a script that intercepts commands to open .xlsx files and does the following:
1) Checks to see if an excel file of the same name is already open in an instance of Excel.  If not, then the file is passed on to Excel/a running instance of Excel to open as normal.
2) If so, a dialog will say "A file of this name is already open in Excel.  Would you like to create a temporary copy of this file with a slightly different name and open it?"
3) Choosing Yes to the above will create a copy of the file with a different name in the user's temporary directory and then open it in the already active Excel instance, thus somewhat defeating the dreaded "Sorry, Excel can't open two workbooks with
the same name at the same time."
Most of the time, people trying to open two instances of a workbook of the same name are doing so to compare them, so making one be a temporary copy is not harmful but rather extremely helpful.  I would guess that most of the time, users receiving this
stop message are fully aware of what they're trying to do and end up immediately making a copy of one of the two files in question with an altered name so that they can go about their business of trying to compare the contents in Excel :).

I'm not a scripter today, but currently code in R, so this doesn't feel out of range for me to try.  My fundamental question at this stage is:  As I've described the workflow above, is PowerShell (or PowerShell + some registry key editing)
the best choice/capable of the interactions I've described?  These are essentially:
1) Intercept any user actions looking to open an Excel file (from windows explorer, from the command line, from the run box, etc.)
2) Examine the call to open the file.
3) Find and query running instances of Excel in order to compare the filenames of what is already opened in Excel to the information from (2).
4) Display a GUI interaction choice to the user to decide how to proceed.
Posts like these two made me think this was a useful forum to post the idea and garner some feedback (The site won't let me hyperlink these titles, but search for them on the Scripting Guy's Blog):
Can I open a file dialog box with Windows PowerShell?
PowerShell and Excel:  Fast, Safe, and Reliable
The examples above also lend me to believe that if it turns out this is extremely simple with just about 10 lines, someone might just provide code which does it.
As an aside, it's not the hardest problem to solve now:  before opening the 2nd file that you already know is a name collision, I quickly hit Ctrl+C, Ctrl+V to make a copy right there in the same directory, and open it instead.  However,
this also requires you to remember you've done this and go back to delete that file before moving on.  In my work, it may be hours before I'm done with the comparison work and it is hard to recall that you have some file cleanup to do afterwards, thus
the idea of a script that would already put the copy in a temp directory for you and also not require you beforehand to remember whether the filename of what you're about to open is identical to one already opened (an enhancement might be to also check whether
the path is the same, i.e., you've made a mistake and are opening a "truly already open" file.)
Thanks in advance if you or any readers have some ideas!

Similar Messages

  • I have a business and I use iCal for all my appointments, how can I print receipts from my MacBook to a receipt printer? I want my clients to have a receipt of the services that they have paid for, can anyone HELP ME PLEASE?

    I have a business and I use iCal for all my appointments, how can I print receipts from my MacBook to a receipt printer?
    I want my clients to have a receipt of the services that they have paid for, can anyone HELP ME PLEASE?

    Well...I went to the modem (Westell, WireSpeed), found the NAT settings, once again, I'm WAY over my head, I am assuming this is a TCP connection (as opposed to a UDP) and per Lorex my mobile devices will use port 1025.  So I gave it a "global port range" of 1-10 and I indicated that the "base host port" was 80, 1025, & 9000 (ports 1,2,3).  When I selected the 'enable' it asked for a "host devise" my choices are my IPhone, IMac and the IP address for the dvr, so I choose the dvr.  I still cannot connect and canyouseeme still can NOT find these open ports.  This is taking up my whole day! I don't know how people figure this stuff out.

  • I have an apple earpods and I use them for my ipad but when I want to skip a song by tapping the middle button twice it doesn't skip the music so what to do?

    I have an apple earpods and I use them for my ipad but when I want to skip a song by tapping the middle button twice it doesn't skip the music so what to do?

    The procedure is Settings>Messages>Send & Receive at>You can be reached by iMessages at>Add another email address. The email address has to be a valid working email address, obviously. Apple should verify the email address and you have to go to the inbox of that email account, read the verification email from Apple and follow the inductions in the email in order to complete the verification. Then you go back to the settings, uncheck your email address and check the new email address to be used as the contact email address.

  • My Old macbook pro that i bought in 2009. I have broke my screen and havent used it for a while, and now i have found out that i can use a monitor , but i have forgot my password is there any way i can make a new password? Thank you for reading this.

    My Old macbook pro that i bought in 2009. I have broke my screen and havent used it for a while, and now i have found out that i can use a monitor , but i have forgot my password is there any way i can make a new password? Thank you for reading this.

    Have you read for possible solutions over in the "More Like This" thread over here?-----------------------> 
     

  • Is there any where that I can voice why I returned my beloved new Ipad? I was told I could move my Keynote presentations to it and then use it for my business presentations. Unfortunately that turned out to not be true. I need the IPad to work with a remo

    Is there any where that I can voice why I returned my beloved new Ipad? I was told I could move my Keynote presentations to it and then use it for my
    business presentations. Unfortunately that turned out to not be true. I need the IPad to work with a remote.
    The Ipad is on a short cable to my projector. I am usually on a podium 30 feet away. No infra red receiver on the IPad and
    the Iphone remote needs wi fi which is not always available in all the locations I do my teaching and lecturing in.
    If you can build a remote into the Ipad in the future I would really like to use an Ipad to replace my heavier lap top for business travel. Thank You Kathy McNeil.

    "The Ipad is on a short cable to my projector."
    Get a longer cable?

  • HT3805 I have Aperture 3 installed and have used it for a while.  Now when I try to open it, the licensing window appears asking for the registration #.  Yet it says it's invalid.  (I have the # from Aperture on another computer.)  Any ideas?

    I have Aperture 3 iinstalled and have used it for quite a while.  Now when I try to open it a licensing window appears and wants the reg #.  I copy it from the program on another comupter, yet it says that it's invalid.  Any ideas?

    Check this support article:
    Troubleshooting Professional Application Serial Numbers:
    http://support.apple.com/kb/TS2005
    Sometimes look-alike characters may be confused, also you may need to enter the previous registration numbers as well, if your Aperture version is an upgrade to Aperture 2 or 1.
    Regards
    Léonie

  • HT2404 Hey everyone I have a MacBook and I use it for papers in college

    Hey everyone I have a MacBook and I use it for papers in college what is the best software to get like Microsoft word can i purchase that software for my MacBook? Also how do I save work I did on my MacBook so it will come up in the correct format for my professor?

    You can buy Microsoft Office for Mac, or get the free NeoOffice
    http://download.neooffice.org/neojava/en/index.php
    NeoOffice is equivalent to Microsoft Office. It can open Excel files, Word files & PowerPoint files. You can also create these types of files that can be opened by PC users.
     Cheers, Tom

  • I have iphone 4 and i used it for a one and half years.i used it in sri lanka and doha qatar,recently i update it i.o.s 7, then it was working.after i.o.s 7.0.3 came i again updeted it and now my phone network is not working.now phone is locked.pls help.

    i have iphone 4 and i used it for a one and half years.i used it in sri lanka and doha qatar also..,recently i update it i.o.s 7, then it was working.after i.o.s 7.0.3 came i again updeted it and now my phone network is not working.now phone is locked.pls help.

    I am seeing if I can get another battery even though I do not believe that is the issue.  It keeps giving me vdd_under which I believe is under voltage, maybe it is just a faulty battery?  It charges up like normal and functions normal (when plugged in, or above 90%) but it gives under voltage warnings and shuts down when in heavy use (using camera or going back and forth to imessage).  When just sitting idle it doesn't seem to turn off until that 55-60% mark.  It may just be a faulty battery because I feel I installed all of the other cables correctly when replacing the screen, and I don't think those connections should affect the battery anyway except for maybe the logic board cable (the 2nd cable to be unplugged after the battery cable) I guess I could clean that out as well with isopropyl just in case.
    Any other suggestions would be helpful... and I will get back to you if a new battery helps.  Thanks!

  • Hello. I have an iphone5 and I use it for a hotspot for mylaptop and printer. Does any one know a device that will extend its range? I have tried a Netgear and Belkin range extenders without any luck. Thank you!

    Hello. I have an iphone5 and I use it for a hotspot for mylaptop and printer. Does any one know a device that will extend its range? I have tried a Netgear and Belkin range extenders without any luck. The Belkin was closest to working. IT could find my iphone but when it create a new network, both the laptop and printer could not find the new extended network. Thank you!

    Hi - you can do what you want to do with AirPlay from your iPhone - but unfortunately it is not as easy as the people in the Apple store told you - your first problem is that you have a non Apple router - you cannot extend a non Apple router wirelessly with the Express - you can only join the network and connect an ethernet device to it - you can however connect via ethernet and have it create a wireless network of its' own - you can set this up from your iPhone or the XP - but this is a complicated setup and would involve many different discussion areas of this forum - therefore I would suggest that you use your 90 days of support and consult directly with Apple to do this - go to this link - http://www.apple.com/support/contact/

  • I have mobile me and I use iDisk for backups.

    If I enroll in iCloud will I still be able to back up everything to my iDisk or is it disabled?

    iDISK will work till june 2012. I do use iCLOUD and still using iDISK for documents... As ICLOUD doesn't synchronize documents on the MAC, only on iPHONE, iPADs

  • [svn] 2768: sanity and error tests have been moved to asc/test/compiler/ and now use the runtests.py script to execute

    Revision: 2768
    Author: [email protected]
    Date: 2008-08-06 14:28:35 -0700 (Wed, 06 Aug 2008)
    Log Message:
    sanity and error tests have been moved to asc/test/compiler/ and now use the runtests.py script to execute
    Removed Paths:
    flex/sdk/trunk/modules/asc/test/errors-and-warnings/
    flex/sdk/trunk/modules/asc/test/sanity/

    Answered myself. JUst named the imput fields incorrectly.
    Couple of other problems also but sorted and now working
    fine...

  • Skip Base station and just use AppleTV for WiFi?

    Hello all.
    I am currently using Airport base station extreme (6th edition) with the Apple TV 3rd edition. My question is,
    I'm moving out and I wanted to split the two up. I would take the base station and leave the AppleTV for my roommate.
    Is it possible to use the AppleTV to broadcast  WiFi single and use it for channels if I plug the cable modem directly to the AppleTv?
    Roommate will only be using the TV with an antenna for local channels and apple TV for netflix. They still want WiFi in the house though for internet.
    What are my options?

    If you want to use it (without a data plan) as a GPS, you'll need to purchase a navigation app that has built-in maps.  Navigon is one, although I can't recommend it.  Google for reviews of others.

  • I have one week old MBP r with a 500 gig ssd. I looked at my storage and im using 147gig for back up. I've backed up onto a time capsule. So what is this 147gig of backups and how do i delete it?

    This is my first Mac, and i was just browsing around when i went into storage and i saw i was using 43.97 gigs for audio, 44.72 gigs for movies, 7.96 gigs for photos, 5.4 gigs for apps, 147.16 gigs for backups and 70.81 gigs for other.
    I've backed up onto a time capsule that i also recently bought. So i would like to know what constitues the "Backups" on my hard drive and how do I delete it to free up more space

  • I have 2 displays 1920 and 3840, use 1920 for every day work, some pages I would like to open in 3840 display, is this possible?

    I have 2 displays 1920x1080 and 3840x2160,
    I use 1920x1080 for every day work, some pages I would like to open in or redirect to the 3840x2160 display, is this possible?

    No, but there is a developer tool that you can add a custom size to. It is called Responsive Design View.

  • No gcc anc cc and  cant use "make" for installation

    Guys,
    I am facing another problem while I try to installation on an tar.gz file. I already unzip the folder and now the problem is have no gcc anc c installed. Where can I get the installer for this gcc an cc?
    The other problem which is there is no "make" command.
    Anyone can help on this? I will be very appreciate it.
    I am from Linux platform and just started to use Solaris and I am struggling now.
    Thanks....

    The best source for applications and such for Solaris is http://www.sunfreeware.com
    Over there you will find dozens (if not hundreds) of popular tools and utilities, pre-compiled for your specified version of Solaris! Over there you will find proper PKG packages that fit your needs.
    Look into installing the following packages and their dependencies:
    * gcc
    * make
    * automake
    * the various C and C++ libraries
    * and so on :)
    Good luck!

Maybe you are looking for

  • BW Report Performance, Accuracy of Data

    Hi, Can someone help give explanations to following questions : 1.) Does BW Report show how current is my data? 2.) What are the reason why the performance of my BW Report is slow? 3.) What are the reason why my BW Report is have missing data? 4.) Wh

  • Can I assign a default value to a parameter like C++ ?

    My question is whether I can assign a default value to a parameter in Java? Let's say : public void myMethod(int p1, int p2=3){...} Is this syntax acceptable ? Regards, WenBin

  • IDE/SCSI Problems with Neo 4 Platinum/Sli

    I am routinely getting Event 11 and Event 9 errors in my event viewer which are basically "The controller detected an error on device " then lists a controller and a harddrive.   I never got errors like this on my old rig (an Asus A7Pro Motherboard)

  • PreparedStatement problem in Oracle OTD(JCAPS 5.1.3)

    Hi, I encountered a problem with Oracle-eway-generated PreparedStatements when trying to build a project in enterprise designer . I know that without using any prepraredstatement, my project builds fine. Below is the text on the error pop-up window:

  • Dynamic Variant to determine current wednesday  date

    Hi, I would like to know how to create a custom Dynamic Selection Variable to determine current wednesday date of the week which I can use in variant. Your response is much appreciated and awarded. Regards Kasi