--- In [email protected], "Sheri" <[EMAIL PROTECTED]> wrote: > > --- In [email protected], "ebennetthill" <benhill@> wrote: > > > > I read a posting from June of this year about > > changing the window title, and I wondered if there is > > some possibility that PowerPro can do what I want. > > > > Excel has the strange quirk of putting the name of the > > program first (Excel)and the file name second. That's > > not too bad for the title bar, but it's inconvenient > > for the taskbar. All I can see there is that I have > > some excel files open. The file names are all but > > obscured. Word doesn't do that, but Excel does. I found > > some VBS code that would fix individual files sort of, > > but has to be inserted into every file that is opened > > to do the job. > > > > Could PowerPro change the window title of every Excel > > file that is opened so that it would read "Book 1 - > > Microsoft Excel" instead of "Microsoft Excel - Book 1"? > > Hi, > > I played with it, its easy enough to change the titlebar text of all > instances of Excel and it seems to be retained until you activate a > different document within the same Excel instance(s). > > However, as far as the taskbar goes, as long as there are multiple > documents open and you're using only one instance of Excel (at least > with my Excel 2003 running in XP) the icon shows the number of > documents open, and if you click the icon, it gives a list of the > documents to choose from (no "Microsoft Excel -"). > > Your taskbar issue only seems to be an issue when there is only one > document open in independent instance(s) of Excel where no secondary > documents have been accessed during the session(s). In that > circumstance, you could run this script on demand (e.g, from a button, > menu item or hotkey) and afterwards taskbar icon will then show what > you want. It will work on all multiple instances of Excel. > > Save this file as exceltitlechg.powerpro in the scripts subdir of your > PowerPro folder. The to set it up for use, select *Script and Runfile > from the controls, and enter exceltitlechg for the Command parameters. > The script uses the regex plugin, which is distributed with PowerPro. > > Regards, > Sheri > > local testcaption, test4chg, correctcap > if (anywindow("c=XLMAIN")) do > myxlcaplist = win.handlelist("c=XLMAIN") > ; win.debug("myxlcaplist ",myxlcaplist) > endif > for (j=1; ;j=j+1) > myevalhandle = word(myxlcaplist,j) > if (myevalhandle == "") do > break > endif > testcaption=win.caption(myevalhandle) > ;win.debug("testcaption ",testcaption) > test4chg = ;;+ > regex.replace(testcaption,;;+ > ?"^(Microsoft Excel) - (.+)$",?"\2 - \1","correctcap") > ;win.debug("test4chg ", test4chg, "correctcap ", correctcap) > if (test4chg == 0) do > win.settext(myevalhandle,correctcap) > endif > endfor > quit > Thanks so much for the obviously sophisticated script. I can't follow it for sure. I couldn't get it to work for me. I tried creating the *.powerpro file and double-clicking it before I ran Excel and after I opened up a file. I also tried assigning the *script>runfile to a button and running it before or after Excel had started. Neither had any effect for me.
As to the taskbar, I do have Excel set to "windows in taskbar" which shows each file separately. I assume teh script works for you. I also use Excel 2003. Do you have any ideas what I might try next to get it to work for me?
