I have a large Excel 2007 workbook. There is a specific worksheet in that workbook called “Router logs” I update every day. I wanted a way to click on a shortcut and open the workbook to that specific worksheet. So with a little help from my friend Bing Google, I created a file called router logs.vbs that contains the following:
Dim xlApp
Dim wbkTempSet xlApp = CreateObject(“Excel.Application”)
Set wbkTemp= xlApp.Workbooks.Open(“C:\Users\billb\Documents\Forum Stuff\On-Line Spreadsheets.xlsx”)
wbkTemp.Worksheets(“Router Logs”).Activate
xlApp.Visible = True
When I click on that .vbs file, Excel opens to the correct sheet as expected. 🙂 I have created a shortcut to that .vbs file and when I click on the shortcut, Excel opens to the correct sheet as expected. 🙂 Note my worksheet opens in the foreground and that window has “focus” – just as expected.
BUT – If I move/copy either the .vbs file or shortcut to my desktop, they still work EXCEPT when I click on the .vbs or shortcut icon, my spreadsheet opens up behind all other open windows and without focus. 🙁
Other desktops item open in the foreground with focus just fine.
I have a second shortcut to the entire Excel Workbook on my desktop and when I click that, the workbook opens in the foreground and with focus just fine (except always to the last worksheet accessed). It is only when trying to open the workbook to that specific Router Logs worksheet that this piddly but very annoying behavior occurs.
As a hardware tech, I don’t know enough to tell if is a .vbs, Excel or Windows problem, or how to fix it. But since other shortcuts work as expected, I don’t suspect Windows. Any help would be appreciated.
Fully updated 64-bit W10 Pro.
Bill (AFE7Ret)
Freedom isn't free!