Please Help with Excel Files/Arrays 
Author Message
 Please Help with Excel Files/Arrays


Quote:
> As a Novice to/in VB script I need help in how to import to an array
> or access from 2 to 50 cell entries in an Excel spreadsheet so that I
> can use a FOR ....Each statement to automate making merge and order files for
> each cell entry to produce data CD's.

> Nothing I have tried works.

> Please Help if you can.

> Wayne

With help from Tom Lavedas the code below will echo the value in each row;
however I have not been able to come up with a way to use the individual values
to generate the listed files I need.

Please, Please Help if you can

*******************************
Dim WorkSheet, oXL, Row, Col, i

WorkSheet = "c:\agency.xls"
  Set oXL = CreateObject("Excel.Application")
  oXL.Visible = False
  oXL.WorkBooks.Open WorkSheet
  Row = 1
  Col = 1
  Do Until IsEmpty(oXL.Cells(Row, Col))
    ' ReDim Preserve aCells(Col - 1)
    ' aCells(Col - 1) = oXL.Cells(Row, Col)
    ' Col = Col + 1
    ReDim Preserve aCells(Row - 1)
    aCells(Row - 1) = oXL.Cells(Row, Col)
    Row = Row + 1
  Loop
  oXL.DisplayAlerts = False
  oXL.Quit

   For i = 0 to Ubound(aCells)
   wscript.echo aCells(i)
   Next  

     ' Dim fso, MergeFile
     ' Set fso = CreateObject("Scripting.FileSystemObject")
     ' Set MergeFile = fso.CreateTextFile("c:\"aCells(i)".txt", True)
     ' MergeFile.WriteLine(aCells(i))
     ' MergeFile.Close

     ' Dim gso, OrdFile
     ' Set gso = CreateObject("Scripting.FileSystemObject")
     ' Set OrdFile = gso.CreateTextFile("c:\order.ord", True)
     ' OrdFile.WriteLine("order_id = number")
     ' OrdFile.WriteLine("file = c:\vbs\number\")
     ' OrdFile.WriteLine("label = c:\vbs\sprint_test01.btw")
     ' OrdFile.WriteLine("labtype = EDITOR_FMT")
     ' OrdFile.WriteLine("merge = c:\vbs\number.txt")
     ' OrdFile.Close

.



Thu, 07 Aug 2003 09:02:10 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Need Help Please on Arrays & Excel

2. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

3. HELP-- filling an array with the contents of Excel-file performs too too too slow-- HELP

4. PLEASE HELP PLEASE HELP PLEASE HELP

5. Excel file cannot be generated from the server using webclasses - Please Help

6. Generating an excel file with webclass not working Please Help

7. need help: Open Excel, run macro, save file, close Excel

8. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

9. Need Excel Automation help, please, please

10. vbs and Excel, help please!!

11. Please help with array

12. *Please* Help with loops, arrays, ducument.write.

 

 
Powered by phpBB® Forum Software