Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I have a workbook that can be copied to and used in any
arbitrary folder, that means each workbook will have a different path. Is there a way to determine the path of a workbook?? (Or path of "ThisWorkbook") Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Dec 26, 5:37*am, "Robert Crandal" wrote:
If I have a workbook that can be copied to and used in any arbitrary folder, that means each workbook will have a different path. Is there a way to determine the path of a workbook?? (Or path of "ThisWorkbook") Thank you! Hey Robert! I use this function below. It presents a "click-and-choose" menu where the user picks the folder he wants. Then the code returns it as a string for you to work. Quite simple, isn't? First, declare this TYPE in your module: Public Type BrowseInfo hWndOwner As Long pIDLRoot As Long pszDisplayName As Long lpszTitle As Long ulFlags As Long lpfnCallback As Long lParam As Long iImage As Long End Type Then, use the code below: Public Function folder_win() As String Dim lpIDList As Long Dim folder As String Dim browse As BrowseInfo ' This TYPE was declared right above lpIDList = SHBrowseForFolder(browse) If (lpIDList) Then folder = Space(260) SHGetPathFromIDList lpIDList, folder folder = Left(folder, InStr(folder, vbNullChar)) folder_win = folder End If End Function Hope it helped you out! Brazillian Hugs! Ronaldo PARIS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Robert,
Dim strpath As String strpath = ThisWorkbook.Path -- Regards, OssieMac "Robert Crandal" wrote: If I have a workbook that can be copied to and used in any arbitrary folder, that means each workbook will have a different path. Is there a way to determine the path of a workbook?? (Or path of "ThisWorkbook") Thank you! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How prevent formulas to get external references/path to current workbook? | Excel Worksheet Functions | |||
Current Workbook Path | Excel Programming | |||
Current Workbook Path | Excel Programming | |||
Current Workbook Path | Excel Programming | |||
Current path to Qualified Path | Excel Programming |