+ Reply to Thread
Results 1 to 19 of 19

Passing Parameters t excel Macro

Hybrid View

  1. #1
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Passing Parameters t excel Macro

    Hi

    What have you tried so far? Use the macro recorder in the first instance to capture the basic macro code, then review it and edit as necessary.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  2. #2
    Registered User
    Join Date
    01-08-2014
    Location
    Chandigarh
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Passing Parameters t excel Macro

    Hi Richard,

    When you say grab the dates in a date variable ,should I grab these date in text file from user via console or entered inside text file.
    And .txt file will be opened if we enter the name of that file in .bat file.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Passing Parameters t excel Macro

    I meant that you should open the txt file from within an Excel macro and then set the variable that you've already dimensioned to the relevant cell in the txt file you've opened. Once you've done that you can close the txt file.

  4. #4
    Registered User
    Join Date
    01-08-2014
    Location
    Chandigarh
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Passing Parameters t excel Macro

    I do not want to open file in the middle of operation .All these scripts need to be scheduled for some specific time so dates should be mentioned initially not in the middle after the files open .
    I need a text file where I can enter dates in the starting and then execute my code.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Passing Parameters t excel Macro

    Quote Originally Posted by Rakeshnegi01 View Post
    I do not want to open file in the middle of operation .All these scripts need to be scheduled for some specific time so dates should be mentioned initially not in the middle after the files open .
    I need a text file where I can enter dates in the starting and then execute my code.
    In that case I don't understand. I was under the impression that the txt file contained a value that you wanted to pass as a parameter in your code. Which is why I couldn't understand your reluctance to get your macro to open the txt file, grab the value in a variable and immediately close the txt file.

    You'll need to explain your exact process.

  6. #6
    Registered User
    Join Date
    01-08-2014
    Location
    Chandigarh
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Passing Parameters t excel Macro

    Scenario is like this.
    I will run execute.bat
    this bat file contains
    Date.vbs
    Makezip.vbs
    mailsend.cmd

    Date.vbs opens a file FetchEmails.xlsm and Pass dates to that vb code inside FetchEmails.xlsm
    On the basis of these dates mails will fetch from outlook inexcel ,then makezip.vbs makes zip of those fetch mails and mailsend.cmd will send mail to specified address.

    What I require is just enter those dates from text file instead of passing it to vbs file.
    One more can date be entered in the form of dd/mm/yyyy instead of yyyy/mm/dd.

  7. #7
    Registered User
    Join Date
    01-08-2014
    Location
    Chandigarh
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Passing Parameters t excel Macro

    Hi Richard,

    I got this http://stackoverflow.com/questions/2...d-with-cscript.
    Can you please check will it be helpful.

+ 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. Passing Array's As Parameters
    By chuckury in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2008, 10:08 AM
  2. Variable passing of parameters in a macro
    By gswhoop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-05-2007, 03:25 AM
  3. passing parameters to dos from vba..
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2006, 11:15 AM
  4. Passing Parameters to Word from Excel
    By jake1729 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2005, 07:47 PM
  5. [SOLVED] Passing parameters from excel to access
    By Jabeen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2005, 08:06 AM

Tags for this Thread

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