ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   make hidden window or workbook visible without specify the name (https://www.excelbanter.com/excel-worksheet-functions/8456-make-hidden-window-workbook-visible-without-specify-name.html)

mango

make hidden window or workbook visible without specify the name
 
dear all,
it is for presentation.
may i know any other way to make my workbook visible without specify the
workbook name? because i have 10 workbooks need to do like this. i open each
workbook 1 at a time so no clash between. i am thinking of using same
shortcut key to make it visible without specify the workbook name

first i make it invisible. here of course i need to specify the workbook name.

MyPath2 = "\\server\temp\ctc.xls#'Debtors & Milestone highlights'!a1"
Set xlx = Workbooks.Open("\\servertemp\ctc.xls", UpdateLinks:=0)
ActiveWorkbook.FollowHyperlink (MyPath2)
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
ActiveWindow.Visible = False

later when need it will use shortcut key to show. here can i make it visible
without specify the name so that i need not to create 10 different sub doing
the same task.
i want to use the same sub for 10 workbook so is there a way no need to
define the workbook here. any coding to make invisible window or workbook to
become visible without need to specify the name?


Sub make_visible()
Range("A1").Select
Windows("ctc.xls").Visible = True
End Sub



Dave Peterson

If your xlx variable still holds the reference to the workbook, maybe something
like:

Dim xlx As Workbook
Dim myWindow As Window
'I used the activeworkbook for testing.
'Set xlx = ActiveWorkbook
For Each myWindow In xlx.Windows
myWindow.Visible = False
Next myWindow


If you put:
Dim xlx as workbook
at the top of your module (out of the scope of any procedure), then unless you
reset your project (or clear that variable some other way), then xlx should
still point to your workbook.


mango wrote:

dear all,
it is for presentation.
may i know any other way to make my workbook visible without specify the
workbook name? because i have 10 workbooks need to do like this. i open each
workbook 1 at a time so no clash between. i am thinking of using same
shortcut key to make it visible without specify the workbook name

first i make it invisible. here of course i need to specify the workbook name.

MyPath2 = "\\server\temp\ctc.xls#'Debtors & Milestone highlights'!a1"
Set xlx = Workbooks.Open("\\servertemp\ctc.xls", UpdateLinks:=0)
ActiveWorkbook.FollowHyperlink (MyPath2)
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 1
ActiveWindow.Visible = False

later when need it will use shortcut key to show. here can i make it visible
without specify the name so that i need not to create 10 different sub doing
the same task.
i want to use the same sub for 10 workbook so is there a way no need to
define the workbook here. any coding to make invisible window or workbook to
become visible without need to specify the name?

Sub make_visible()
Range("A1").Select
Windows("ctc.xls").Visible = True
End Sub


--

Dave Peterson


All times are GMT +1. The time now is 09:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com