1.

Solve : Need help - excel to batch file?-?

Answer»

I need HELP please.... how can i link the data from excel to the batch file?

ex.

test.xls
Column A Column B Column C
Row1 123 456 789
Row2 321 654 987

test.bat
ABC(Column A Row1) + DEF(Column B Row1) + GHI(Column C Row1)
.......

Please can you guys help me? why do you need a batch file?
In excel go to cell D1 and type Code: [Select]=sum(A1:C1)
FBif you do need the data in a batch file then you can output a certain cell, range, or file to a text file using VBA http://www.cpearson.com/excel/ImpText.aspx and then import that to you batch file

FBActually I will use this in my work to be more accurate. i already made a batch file but it will take me for a long time to finish my work.

@echo off

:start
CLS
Echo Product Defenition
echo.

set /p siteid= Site ID:
set /p Pcode= Product Code:
set /p Bcode= Barcode:
set /p Pname= Product Description:

echo.
echo "100";"A";657309;%siteid%;"%Pcode%";1;"%Bcode%";"%Pname%";"EA";1;"EA";1;0;0
echo "100";"A";657309;%siteid%;"%Pcode%";1;"%Bcode%";"%Pname%";"EA";1;"EA";1;0;0 >> c:\docume~1\%username%\desktop\proddsc.txt
echo.
echo.
set /p add= Add more products(Y/N):
if %add%==Y goto start

pause

i don't understand what your problem is, does that code not work?

FBokay, the code work but you will input the data manually. if the data will come from excel how will i do that?

it's alright if not possible. thanks for your effort

one more question
- how will i input only numeric or letters? and max character input

thanksQuote

if the data will come from excel how will i do that

Excel spreadsheets use a proprietary file organization. Batch files can only process text files. You can use any COM aware script language (VBScript, JScript, Python, etc) to create an external script that can process the XLS file format.

You can use VBA to create an internal script that will run WITHIN the Excel application.

Good LUCK.



Discussion

No Comment Found