ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Locating the directory a workbook is stored in (https://www.excelbanter.com/excel-programming/369356-locating-directory-workbook-stored.html)

Graham Whitehead

Locating the directory a workbook is stored in
 
Hi, I was just wondering if it possible to get excel to return the location
of the workbook that is currently in use. If so does anyone know the VBA
code to do this? Thanks.



Bharath Rajamani

Locating the directory a workbook is stored in
 

try this --

Dim wsh1 as Worksheet
Dim sPath as String

Set wsh1 = ActiveWorkbook.Worksheets(1)
sPath = ActiveWorkbook.Path & "\"


Rgds,

"Graham Whitehead" wrote:

Hi, I was just wondering if it possible to get excel to return the location
of the workbook that is currently in use. If so does anyone know the VBA
code to do this? Thanks.





All times are GMT +1. The time now is 01:30 AM.

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