+ Reply to Thread
Results 1 to 7 of 7

Can you do Early Binding to an Excel Workbook thats already open?

  1. #1
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Question Can you do Early Binding to an Excel Workbook thats already open?

    Hi,

    I am searching Google ATM, & not seeing a clear answer. From what I seen in my reading it looks like people open the object when doing EarlyBinding.
    So the question can we do earlyBinding with an already open object & if its possible how would one do this?

    lol, I dont even know if thats the problem I just assume, cause my code worked with:
    "Set wBk = Workbooks.Add", but I changed that to:
    "Set wBk = ActiveWorkbook".
    Now I get a 438 RunTimeError Object doesn't support this property or method on this line.
    Dim CodeNameProp As VBIDE.Property: Set CodeNameProp = vbProps(NewName)

    Im trying to programmatically change my Sheets CodeNames.

    TIA for any help

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,517

    Re: Can you do Early Binding to an Excel Workbook thats already open?

    I'm not sure the problem is connected with wBk as you don't actually reference that in the code that causes the error.

    What is vbProps in that code?

    Can you post the rest of your code?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Can you do Early Binding to an Excel Workbook thats already open?

    Hi,
    Just let me start off by say what an honor it is that your helping me. I have read soo.... many of your posts.
    lol while I was cleaning up my code to present to you I fixed it. I change:
    Set CodeNameProp = vbProps("_Codename")
    to
    Set CodeNameProp = vbProps("MyVar") when I was testing & just now I changed it back it worked.
    Thats how BadAs# you are. You just ask for the code & problems fix themselves. +1Rep 4 you Norie thanks you fix & Solved this for me simply by requesting to view the code. [If only all of lifes problems were solved, so easily].
    However, now that its working I can see that my loop isn’t working correctly. I haven’t had enough practice with them to really know what Im doing yet. I just mention cause, maybe if you wouldnt mind. When your done laughing at my code you could help with the loop & the overall procedure. Like am I doing anything dumb I shouldnt be doing? [Aside from reIndexing my sheets].
    Ok now down to business heres my Code:
    Please Login or Register  to view this content.
    I am such a wanna-be geek. I cant believe how much I gush when one of you guys acknowledge me ahh.. I need help. lol…
    Oh, my loop isnt working; in the way-of I keep renumbering the sameSheet & the messageBox is echoing back the next Sheet.Name.
    [You probablly knew without me saying, but yeah thats what its doing]

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,517

    Re: Can you do Early Binding to an Excel Workbook thats already open?

    What is it you want to do with the code?

  5. #5
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Can you do Early Binding to an Excel Workbook thats already open?

    Loop through the workbook & renumber my sheetsCodeNames. In a workbook I have they are all over the place with the lowest number being 50 something. I would like it to be 1-300 or whatever.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,517

    Re: Can you do Early Binding to an Excel Workbook thats already open?

    Perhaps.
    Please Login or Register  to view this content.
    By the way, changing the codenames of the sheets won't change the order they will be looped through or there position in the workbook.

  7. #7
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Re: Can you do Early Binding to an Excel Workbook thats already open?

    So…. AWESOME !!!! You just saved at least half a day, never mind getting me un-stuck with my original problem. You’re a Gem a million thankYOUssss……..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Learning differences between Early Binding & Late Binding
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-28-2013, 01:16 AM
  2. [SOLVED] Seeking knowledge on Early Binding, Late Binding
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2013, 10:45 PM
  3. Conversion from early binding to late binding
    By bettingman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2011, 04:10 AM
  4. Early binding reference list, add all?
    By Jaymond Flurrie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2008, 03:45 AM
  5. [SOLVED] Early and Late Binding Vba Excel
    By VJ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2005, 02:06 PM

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