+ Reply to Thread
Results 1 to 3 of 3

workbook name

  1. #1
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    workbook name

    I have a formula to pull the workbook name but is there a way to do it in code?

  2. #2

    Re: workbook name

    Hi Ceemo,

    Try Activeworkbook.Name also if you also need location you could use
    Activeworkbook.FullName.

    James

    ceemo wrote:
    > I have a formula to pull the workbook name but is there a way to do it
    > in code?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=548546



  3. #3
    Chip Pearson
    Guest

    Re: workbook name

    You can use ActiveWorkbook.Name or .FullName to return the name
    or full name of the workbook that is active, regardless of what
    workbook contains the code. You can use ThisWorkbook.Name or
    ..FullName to return the name of the workbook which contains the
    code, regardless of what is active.

    If you are going to be calling this from a worksheet cell, use

    Function WorkbookName() As String
    WorkbookName = Application.Caller.Parent.Parent.Name
    End Function


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "ceemo" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I have a formula to pull the workbook name but is there a way
    > to do it
    > in code?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:
    > http://www.excelforum.com/member.php...o&userid=10650
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=548546
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1