+ Reply to Thread
Results 1 to 7 of 7

Genrating the output to a .bat file from xls

  1. #1
    Registered User
    Join Date
    06-08-2011
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    20

    Genrating the output to a .bat file from xls

    HI,

    Through some vba code I am generating some c program script to column G in a xls file.

    Example:- (below sample values are present in column G)
    HTML Code: 
    I am using the below script to copy the contents of the column G to a .bat file.

    Please Login or Register  to view this content.
    But I am getting some error, I have gone through the code multiple times but could not fix it. Anybody please tell me where I am doing wrong

    Thx,
    Deepti

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Genrating the output to a .bat file from xls

    Perhaps you could share what the error was and what line, if any, is highlighted when you debug the error?

    For Each cell In Range("G5:G1005" & RR)

    You could remove the & RR as it is not set to anything.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-08-2011
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: Genrating the output to a .bat file from xls

    Hi,

    I have removed the &RR, when I am executing the macro I am getting error on this line.

    Please Login or Register  to view this content.
    Thx,Deepti

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Genrating the output to a .bat file from xls

    What is the error description?
    Do you have a sheet named "Scripts"? If yes, what is in cell G5?
    Do you have the folder C:\Automation ?

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,636

    Re: Genrating the output to a .bat file from xls

    never mind....
    Last edited by protonLeah; 09-02-2013 at 01:09 AM.
    Ben Van Johnson

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Genrating the output to a .bat file from xls

    Quote Originally Posted by protonLeah View Post
    Put the line:
    Debug.Print FILENAME before the Open.. statement and see if it matches the actual file name.
    The code is creating a file. I don't think FILENAME matches an existing file.

  7. #7
    Registered User
    Join Date
    11-27-2012
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Genrating the output to a .bat file from xls

    Perhaps something like this would work?

    Please Login or Register  to view this content.

+ 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. Comparing 4 excel file and make output in new file
    By lovinguy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2013, 11:27 PM
  2. [SOLVED] Open CSV file, format data and write output to a text file.
    By BristolBloos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2005, 11:05 AM
  3. Output to a file?
    By Kevin Burton in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2005, 11:05 PM
  4. A macro for output an excel file to text file
    By cmk_excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2005, 04:44 AM
  5. CSV output file
    By Suzanne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2005, 01:06 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