+ Reply to Thread
Results 1 to 7 of 7

Using Named Ranges or cellsreferences in .XLA

  1. #1
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Using Named Ranges or cellsreferences in .XLA

    Hi there ,
    This is my first request through this forum, and i'll try to explain my problem.
    I would like to use cell reference or Range Names within an Addin (.xla) file.
    Attached you'll find a testfile.
    (Example attached must be saved as an Addin.)

    For example , i would like to get a numeric value from the user in a userform, the Addin needs to put that value in a cell or range name within the .xla file for futher use in the future.

    Is it possible to use cell reference within an .XLA file??

    Thanks for your help
    Mario
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: Using Named Ranges or cellsreferences in .XLA

    Hi

    Have you tried:

    Please Login or Register  to view this content.
    ?

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  3. #3
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Using Named Ranges or cellsreferences in .XLA

    Richard ,

    I did not try it , because i think the ThisWorkbook.Sheets is referring to the open workbook or am i mistaken?
    Or do i need to refer as : MyAddin.("Sheet1").Range("A1").Value = "Some value"

    Mario

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Using Named Ranges or cellsreferences in .XLA

    ThisWorkbook refers to the workbook containing the code.
    Activeworkbook refers to the active workbook.
    Remember what the dormouse said
    Feed your head

  5. #5
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Using Named Ranges or cellsreferences in .XLA

    Hi guys ,

    The code with "Thisworkbook....." works fine, thanks for that.
    How can i be sure the last updated values within XLA file are saved.
    When i close Excel and reoopen it , the last values are not saved with the XLA file.
    How can i do this?

    Thanks
    Mario

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Using Named Ranges or cellsreferences in .XLA

    As with changes to any workbook, you need to ensure the workbook is saved after you make the changes (thisworkbook.save)

  7. #7
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Using Named Ranges or cellsreferences in .XLA

    Quote Originally Posted by romperstomper View Post
    As with changes to any workbook, you need to ensure the workbook is saved after you make the changes (thisworkbook.save)
    Of course.
    Me been stupid.

    Thanks a lot.
    For me this post has been solved.

+ 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