Open Excel Book - Page 2
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Open Excel Book

  1. #11
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I know what your trying to do that is what I am also trying to do create a univeral workbook that works no matter where its put you can refer to a variable as the workbook name and directory that makes the macro run slower but other wise does anyone have any code for this that picks up the workbooks current location??

  2. #12
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-02 20:30, brettvba wrote:
    I know what your trying to do that is what I am also trying to do create a univeral workbook that works no matter where its put you can refer to a variable as the workbook name and directory that makes the macro run slower but other wise does anyone have any code for this that picks up the workbooks current location??
    Try this mod to J walkenbacks formula

    Function GetDirPath_ThisWorkbook() As String
    'Returns the path from a filespec
    Dim x As Variant
    x = Split(ThisWorkbook.FullName, Application.PathSeparator)
    ReDim Preserve x(0 To UBound(x) - 1)
    GetDir_ThisWorkbook = Join(x, Application.PathSeparator) & Application.PathSeparator
    End Function

    HTH
    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #13
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Does the following not work?

    Code:
    Dim x As Variant
    x = ThisWorkbook.Path & ""
    Where the double backslash is really only one.

    Cheers, Nate

    [ This Message was edited by: NateO on 2002-04-03 07:36 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com