+ Reply to Thread
Results 1 to 2 of 2

Run vba script without opening macro file

  1. #1
    Forum Contributor
    Join Date
    11-06-2021
    Location
    Tripoli
    MS-Off Ver
    Still using 2007 in 2023
    Posts
    289

    Red face Run vba script without opening macro file

    Hello guys,
    I hope you are all fine.
    I am a totally vba newbie with little enquiries.
    Could i launch my vba script without the need of opening two of my files simultaneously(a macro file holding the code, and a file named "o" where columns are extracted). Since if i don't open both files i would receive a message (error 9: subscript out of range)
    Also, in case the workbooks that are generated had already exist, i dont want to receive a message stating to replace it? i prefer to replace it right away with the new one without notice...
    I am thankful for any kind amendment to my below code, or any advice.
    God bless you

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    917

    Re: Run vba script without opening macro file

    - To read from a file you need to open it, copy what you need and then close it again. All this could be done by macro.
    - To avoid messages just use the function Application.DisplayAlerts = False before the line of Saving code and Application.DisplayAlerts = True just after Saving or just before Ending the Sub.

+ 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. script to run the macro from Vb script with out opening the excel file
    By chandanp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2021, 03:33 AM
  2. #NAME? when Macro is ran using a VB script file
    By Samisback in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2015, 03:40 PM
  3. Script/macro to save a copy as tab delimited text file and then close original file
    By Merlin803 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2015, 01:34 PM
  4. need help in writing a vba script to run a macro (.xlam file) on a .csv file
    By NeoDasari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-30-2015, 02:02 PM
  5. Opening files macro help (forcing directory, opening a tsv file)
    By NukedWhale in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2010, 03:07 PM
  6. Opening an excel file using a script
    By matpj in forum Excel General
    Replies: 3
    Last Post: 05-08-2006, 05:30 PM
  7. VBA Script in Excel Stalls Out On It's Own After Opening Secondary Excel File
    By SilentThunder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2005, 06: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