From: Raz on 19 Feb 2010 03:58 Hi, Is there any way to get the name of a hidden WB in which the code is written? Ofcourse using "Activeworkbook.Name" will give me the name of the active wb and since the wb I'm trying to get is hidden, it's not really active. I also tried "Windows(1).caption" but whenever I open another workbook the index of the hidden workbook might change.. I can't expect the order the user will open the workbooks.. I want the macro to give me the name of the workbook in which it's written. is there any way to do it? thanks.
From: Jacob Skaria on 19 Feb 2010 05:05 Try ThisWorkbook.Name -- Jacob "Raz" wrote: > Hi, > > Is there any way to get the name of a hidden WB in which the code is written? > > Ofcourse using "Activeworkbook.Name" will give me the name of the active wb > and since the wb I'm trying to get is hidden, it's not really active. > > I also tried "Windows(1).caption" but whenever I open another workbook the > index of the hidden workbook might change.. I can't expect the order the user > will open the workbooks.. > > I want the macro to give me the name of the workbook in which it's written. > > is there any way to do it? > > thanks.
From: Raz Boyarski on 19 Feb 2010 05:28 Hi, you've solved my problem. you have no idea how much time I spent on trying to get the solution to the problem.. I had no idea it's that easy. thank you very much! > Try > ThisWorkbook.Name > "Raz" wrote: > >> Hi, >> >> Is there any way to get the name of a hidden WB in which the code is >> written? >> >> Ofcourse using "Activeworkbook.Name" will give me the name of the >> active wb and since the wb I'm trying to get is hidden, it's not >> really active. >> >> I also tried "Windows(1).caption" but whenever I open another >> workbook the index of the hidden workbook might change.. I can't >> expect the order the user will open the workbooks.. >> >> I want the macro to give me the name of the workbook in which it's >> written. >> >> is there any way to do it? >> >> thanks. >>
|
Pages: 1 Prev: Excel Files not opened Next: Macro to change pivot field with latest value |