+ Reply to Thread
Results 1 to 14 of 14

Opening workbooks with wildcard

  1. #1
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Angry Opening workbooks with wildcard

    Hi

    I am having an issue with this piece of code not working on my home pc (XP and excel 2010) whilst working with no issues on my work pc (win 7 and excel 2010).

    Please Login or Register  to view this content.
    Can someone suggest an alternative code and a reason as to why this is happening?

    I dont want to have two different sets of code. This is madness.
    Last edited by redmarko; 08-31-2013 at 03:46 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Opening workbooks with wildcard

    Hi, redmarko,

    please wrap your procedure in Code-Tags and rethink the title of this thread: if you loop through the workbooks in an instance the workbook you search for must be opened, according to your code you want to activate it (why???).

    Either Use
    Please Login or Register  to view this content.
    which will deliver > 0 if the string is incorporated in the name (position of first string of match) or
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    Hahobe

    The workbooks are indeed open. I want to activate these workbooks to copy worksheets from them into the main spreadsheet from which I am running the code.

    None of your suggested codes worked.

    The code I have is perfectly logical and runs good on my work pc.

    Is there are problem with using wildcards or something??

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Opening workbooks with wildcard

    Is there only one workbook named item report? Is the wildcard for the file extension? I think part of Holger's question is why loop through all of them if you're only trying to work with one of them?


    e/
    Please do not create duplicate posts for the same issue. http://www.excelforum.com/excel-prog...t-working.html
    Last edited by Solus Rankin; 08-31-2013 at 03:18 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  5. #5
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    Solus

    There are multiple item reports. There could be anything up to 30.

    This isnt a duplicate post. The first post was about searching and opening workbooks using wildcards.

    This thread is about workbooks which are open and activation off.#

    The two posts are kind of linked in that wildcards are my problem.
    Wildcards that work on my pc at work but not at home.
    Last edited by redmarko; 08-31-2013 at 03:56 PM.

  6. #6
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    A difference that I have noticed between what is happening at work and at home is the way the workbooks are opening.
    In work when I open multiple workbooks they open up under one session and show as one tab in the windows taskbar. At home the workbooks open in individual tabs.

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Opening workbooks with wildcard

    Sounds like they are opening in multiple instances of Excel.

    If I'm not mistaken. The workbooks collection is only the workbooks open in the current instance of the application.

  8. #8
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    Yes it looks that way but they wont open any other way.

  9. #9
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Opening workbooks with wildcard

    Hi, redmarko,

    if you open the files from the Windows Explorer or FileDialogue and have them opened in multiple instances please have a look for a checkmark next to
    Please Login or Register  to view this content.
    If it is checked please uncheck and try again.

    Ciao,
    Holger

  10. #10
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    HaHoBe

    It is unchecked already. I have googled and tried most other suggestions without success.
    I am going to uninstall and re-install office.

  11. #11
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    Ok I uninstalled and reinstalled office 2010 and my workbooks continue to open in seperate instances. My code is still not running correctly.

    I then installed same version of excel on my daughters laptop (win 7) and when i open multiple excel files they open up in a single instance but the code still does not work.

    Im totally baffled now. The only place my code works is on my work pc.

    Please Login or Register  to view this content.
    Can anyone suggest code to replace above code?

  12. #12
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645
    Use code to open the workbooks.
    If posting code please use code tags, see here.

  13. #13
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    Norie

    Give us a clue!!

  14. #14
    Registered User
    Join Date
    04-07-2013
    Location
    belfast
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Opening workbooks with wildcard

    I finally have an answer.

    Got it in VBAexpress.com!!
    I have no idea why it works but it does. The logic of vba, lol.

    Please Login or Register  to view this content.
    It seems that you have to write different code to suit slightly different pc setups.
    So much for transferability. I bet the code above will probably cause a problem on my pc at work.

+ 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. Opening, Closing, and Opening Excel workbooks from MS Project
    By m007schneider in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2013, 03:22 PM
  2. Opening Workbooks Automatically Versus a User Opening Them
    By tmanes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2012, 03:00 AM
  3. [SOLVED]:Opening workbooks and enabling user defined macros to run in those workbooks
    By vbarookie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-05-2012, 12:00 AM
  4. Using Wildcard (*) to select Workbooks to Close
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-23-2009, 05:37 PM
  5. [SOLVED] Using Wildcard on Workbooks.Open
    By Stever in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2005, 05:05 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