+ Reply to Thread
Results 1 to 22 of 22

Open workbook, and get its name, and make it active window.

  1. #1
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Open workbook, and get its name, and make it active window.

    Hi guys

    i had this code working.... now it seems to not work... :S

    here is my code.

    Please Login or Register  to view this content.
    i know why the code stops, its because there is no sheet with that name in the active workbook.

    but for the love of me when i open the new file, it should become the active window yes? and then i can store that name?

    but i just can never get the opened files to become the active window

    is it because im using a different method of opening the file instead of workbook.open that i cant grab the name?

    cheers

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Open workbook, and get its name, and make it active window.

    Try this,
    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Open workbook, and get its name, and make it active window.

    Hello Andrew Andromeda,

    This line of code may be your problem...
    Please Login or Register  to view this content.
    This makes the workbook that the macro code is in the Active Workbook and NOT this workbook...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    Quote Originally Posted by davesexcel View Post
    Try this,
    Please Login or Register  to view this content.
    this still stops on the selection of the sheet named "SignIQ Price Changes"

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Open workbook, and get its name, and make it active window.

    Does the sheet name match the code name?

  6. #6
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    Quote Originally Posted by davesexcel View Post
    Does the sheet name match the code name?
    i thought about that after i posted on the forum, i checked the names, they are the same :S

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Open workbook, and get its name, and make it active window.

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  8. #8
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    its to large to attach for others to directly work on.

  9. #9
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    i have changed my code to this

    Please Login or Register  to view this content.

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

    Re: Open workbook, and get its name, and make it active window.

    Which workbook is the sheet 'SignIQ Price Changes' in?

    Is it the workbook the code is in or is it the workbook you are opening?

    Also, where is the code located?
    If posting code please use code tags, see here.

  11. #11
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    "SignIQ Price Changes", sheet is in the workbook im trying to open.


    i feel i should be declaring the workbooks name with the sheet name. but i just cant seem to get the file iv just opened to become the active window.
    Last edited by Andrew Andromeda; 01-20-2015 at 08:21 AM.

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

    Re: Open workbook, and get its name, and make it active window.

    Where in the workbook is it located?

    A standard module? A worksheet module? The ThisWorkbook module?

  13. #13
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    Quote Originally Posted by Norie View Post
    Where in the workbook is it located?

    A standard module? A worksheet module? The ThisWorkbook module?
    the code is in a button, on a userform.

    Please Login or Register  to view this content.

  14. #14
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Open workbook, and get its name, and make it active window.

    Attach a sample of the workbook to open.

  15. #15
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    i cant it's to large to upload.

  16. #16
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.


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

    Re: Open workbook, and get its name, and make it active window.

    Andrew

    That file is blocked, probably because it's an exe.

  18. #18
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    i should note that if you open it, i have compiled it into a EXE file, if you click on the text on the bottom left corner that says "Version 2.0" 10 times with your mouse, it will make the application.visible = true code run and excel will come back from there, you will be able to access VB, the Sign IQ button on the main menu form, is where the code is.

    hope this makes sense.

  19. #19
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    Quote Originally Posted by Norie View Post
    Andrew

    That file is blocked, probably because it's an exe.
    you cant run exe's ?

  20. #20
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    i've found a old version that is not a EXE i just ran it, and it seems to work just fine, i dont know why the code works in it tho. I looked at the code and it seems pretty much exactly the same.

    https://www.dropbox.com/s/l8j67lgrm6...1%29.xlsm?dl=0

    old file version here

  21. #21
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    i can confirm, its the conversion to EXE that causes it to stop working

  22. #22
    Registered User
    Join Date
    08-22-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    81

    Re: Open workbook, and get its name, and make it active window.

    it seems when i had compiled it i had set it to EXCLUSIVE WINDOW which meant i could not reference other windows. iv tried a compiled version with out this option and it still worked after compling it to a EXE

+ 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] Make IE8 the active window
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-28-2014, 01:41 AM
  2. Replies: 5
    Last Post: 04-16-2013, 03:01 PM
  3. [SOLVED] Make Open Workbook Active Irrespective Of Name
    By OzTrekker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2012, 10:07 PM
  4. open .txt download in active instance/window
    By Ramona in forum Excel General
    Replies: 3
    Last Post: 03-28-2006, 05:35 PM
  5. [SOLVED] Using double click on active cell to open a custom help window
    By burl_rfc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2006, 05:55 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