+ Reply to Thread
Results 1 to 5 of 5

Method not valid with out a suitable object Error

  1. #1
    Registered User
    Join Date
    10-04-2011
    Location
    zurich
    MS-Off Ver
    Excel 2003
    Posts
    34

    Method not valid with out a suitable object Error

    Hi ,

    I am creating two .bat files using vb script, the first script is created based on the cell range cell In Range("K67:K87"), I am facing issue when generating second batch file, I need to execute the first batch file using the second batch file and capture the log as below.


    Print Execue_Batch_load.bat > Execue_Batch_load.bat.Log 2 > &1


    When I am executing the second script , I am getting a error like Method not valid with out a suitable object.

    Please let me know where I am doing it wrong.
    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Regards,
    Swathi

  2. #2
    Forum Contributor
    Join Date
    06-09-2011
    Location
    Germany
    MS-Off Ver
    Excel 2016
    Posts
    194

    Re: Method not valid with out a suitable object Error

    Hi,
    not sure if this was on purpose, but did you notice you have entered Execue rather than Execute (t minning) in some parts of your code?
    Regards

    Theo
    Remember To Do the Following....
    1. Upload sample files
    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.

  3. #3
    Registered User
    Join Date
    10-04-2011
    Location
    zurich
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Method not valid with out a suitable object Error

    Hi,

    Sorry for the Typo, I want to generate the below line using a macro.

    Print Execute_Batch_load.bat > Execute_Batch_load.bat.Log 2 > &1

    Regards,
    Swathi

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,466

    Re: Method not valid with out a suitable object Error

    I think we'd need to see what's in the cells and hence what the scripts look like.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    10-04-2011
    Location
    zurich
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Method not valid with out a suitable object Error

    HI,

    The range of cells (K67:K87) has, some data load Parameters as below.

    1. Monday,04/06/2012 DataLoaded 252 Records Processed.
    2. Tuesday,05/06/2012 DataLoaded 252 Records Processed.
    3. Wednesday,06/06/2012 DataLoaded 252 Records Processed.
    4. Thursday,07/06/2012 DataLoaded 252 Records Processed.

    The above range of cells I am writing to a batch file i.e through the first program to Execue_Batch_load.bat.

    second batch file is a dummy batch file, which will execute first batch batch file for capturing the log of the first batch file.

    Execute_Batch_load.bat > Execute_Batch_load.bat.Log 2 > &1

    I tried use the above dummy statement in first batch program itself but it's giving the same error, please let me know where I am doing it wrong.

    Regards,
    Swathi

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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