vbscript - VB Script copy csv file data to excel sheet. please help me any other way -
sub addcsvdatatoxcel () 'file names to ask the user filename = "e: \ Surendra \ Excel_Testing \ NewTemplate \ C_0_1 \ AccelVsTime.csv "Check for an entry" if the file name = "" ends "'Get the next available file handle number FileNum = FreeFile () Open the open text file for the input file name set 'counter 1 counter #FileNum as in = 1' loop until the file has not yet expired (file News) & lt; = a OFF (File New) Display the display of a row number on the status bar 'Store a line from the store store for variable line input #Filename, Result store OExcelReadWorkSheet2 splitValues = Split (ResultStr, ",") Change the variable data in the active cell counter (counter, 1) = (split value (0), crow (34), ""). Change the cell (counter, 2) = (split value (1), crow (34) ""). (counter, 3) = Change (Split value (2), Crow (34), "") Ksel (counter, 4) = Change (Split Vely (3), Crow (34), "" the end cells (counter + 5, 5) with) = Change (Split valve (4), Crow (34), "") "room (C opponent + 5, 6) Repeat the statement from 'Close' Open the closed file file '' Statement Loop ',' Resume at the counter 'counter + counter' + '(Split value (5), Crow (34), "") Counter = Counter + 1' I want to copy to oExcelReadWorkSheet2 is a worksheet object where I data. When I run this code directly from Excel it is working. But when I save it as a VBS file and I am running, I am getting the following error: Compilation Error: "Open file name as #Filen for Binayl" on Expected End of Statement `` Does anyone know how can I solve this error?
The VBA is not VBScript. Instead of the VBA Open, OpenTextFile, Readline, and. Clos way to use.
Comments
Post a Comment