+ Reply to Thread
Results 1 to 4 of 4

Renaming a workbook without saving

  1. #1
    Matt
    Guest

    Renaming a workbook without saving

    Hello Everyone

    I'm trying to rename a workbook, so that I can select it later on in the
    macro as I move between different workbooks. I do not want to save it though
    as I do not want to keep the file and it will also take up time

    I've tried a simple

    ActiveWorkbook.Name = "Analysis Code Data"

    But this won't work as I am trying to 'assign a read-only property'

    Thanks in advance for any help



  2. #2
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    could you explain your process abit more in detail.

    do you have like a master workbook which open another workbook then you want to shift from one to the other?

  3. #3
    Norman Jones
    Guest

    Re: Renaming a workbook without saving

    Hi Matt,

    A workbook can only be named as part of a save process.

    Try, instead setting thw workbook to an object variable which you can
    subsequently reference in your procedure, e.g.:

    Dim WB As Workbook

    Set WB = ActiveWorkbook


    ---
    Regards,
    Norman



    "Matt" <Matt@discussions.microsoft.com> wrote in message
    news:35358124-7F47-417C-AA07-E15A73DCFA15@microsoft.com...
    > Hello Everyone
    >
    > I'm trying to rename a workbook, so that I can select it later on in the
    > macro as I move between different workbooks. I do not want to save it
    > though
    > as I do not want to keep the file and it will also take up time
    >
    > I've tried a simple
    >
    > ActiveWorkbook.Name = "Analysis Code Data"
    >
    > But this won't work as I am trying to 'assign a read-only property'
    >
    > Thanks in advance for any help
    >
    >




  4. #4
    Matt
    Guest

    Re: Renaming a workbook without saving

    Thanks Norman

    That does exactly what I was after

    Cheers

    Matt


    "Norman Jones" wrote:

    > Hi Matt,
    >
    > A workbook can only be named as part of a save process.
    >
    > Try, instead setting thw workbook to an object variable which you can
    > subsequently reference in your procedure, e.g.:
    >
    > Dim WB As Workbook
    >
    > Set WB = ActiveWorkbook
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Matt" <Matt@discussions.microsoft.com> wrote in message
    > news:35358124-7F47-417C-AA07-E15A73DCFA15@microsoft.com...
    > > Hello Everyone
    > >
    > > I'm trying to rename a workbook, so that I can select it later on in the
    > > macro as I move between different workbooks. I do not want to save it
    > > though
    > > as I do not want to keep the file and it will also take up time
    > >
    > > I've tried a simple
    > >
    > > ActiveWorkbook.Name = "Analysis Code Data"
    > >
    > > But this won't work as I am trying to 'assign a read-only property'
    > >
    > > Thanks in advance for any help
    > >
    > >

    >
    >
    >


+ 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