+ Reply to Thread
Results 1 to 6 of 6

WScript.Shell and array of filenames

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office XP to Office 2016
    Posts
    1,706

    WScript.Shell and array of filenames

    Hi,

    I don't know whats wrong with the code snippet that I am trying to post for help. I am receiving the attached messages
    and have also attached my quer

    Mods will you please review my attached Query.txt file and post for me?
    Attached Images Attached Images
    Attached Files Attached Files
    Teach me Excel VBA

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    41,281

    Re: WScript.Shell and array of filenames

    We will not be able to post it for you. There is something in the code, maybe HTML, that Sucurri doesn't like, and so nobody will be able to post it here, not even mods and admins. Sorry.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office XP to Office 2016
    Posts
    1,706

    Re: WScript.Shell and array of filenames

    Ok

    I think this should not harm the system.
    Attached Images Attached Images

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    41,281

    Re: WScript.Shell and array of filenames

    It's illegible. Post your questions in your next post along with the code in a .txt file.

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office XP to Office 2016
    Posts
    1,706

    Re: WScript.Shell and array of filenames

    Hi

    I am using the attached code to list all xlsm files in a directory and its sub folders that start with either of 3 string in TaskFileType array
    I am facing 2 issues

    1: A DOS black screen flashes as many times as the number of TaskType (can it be set to invisible?

    2: Can I some way adjust all types inside the code line in red and not use a loop?
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office XP to Office 2016
    Posts
    1,706

    Re: WScript.Shell and array of filenames

    Ok let me shorten the question

    The code bellow (taken from snb's website) lists all xlsm files in a directory and its sub directories

    PHP Code: 
    ComboBox1.List =   Filter   (Split (CreateObject ("wscript.shell").   exec   ("cmd /c Dir ""G:\test folder\*.xlsm"" /  b  / a - d / s").stdout.readallvbCrLf), "."
    is it possible to further narrow it down to list only those xlsm files the name of which starts either of the bellow strings

    "Send Emails*.xlsm" OR "Collect Data*.xlsm" OR "Create Company"

+ 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] Replace MsgBox with WScript.Shell.PopUp
    By waimea in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-23-2018, 11:06 AM
  2. [SOLVED] Timer not always working [timeout in WScript.Shell Popup method]
    By MrMyagiii in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2018, 03:02 AM
  3. WScript.Shell error 'Outside Procedure'
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2017, 06:43 AM
  4. [SOLVED] Using CreateObject("WScript.Shell") for non special folders
    By laxminarayana in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-05-2016, 12:52 PM
  5. [SOLVED] WScript.Shell Not Working Under Excel 2013
    By yossicadaner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2014, 10:55 AM
  6. Replies: 4
    Last Post: 05-07-2012, 07:13 PM
  7. using WScript.CreateObject("Wscript.Shell
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2005, 02:20 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