Hi kkknie,
Yes, I was trying to use VBScript to pull info from the database and spit it out onto an excel spreadsheet.
Your Info wasn't useless. Infact, IT WORKED.
That's what I need to know! the 'NumberFormat' property!
I am not sure what you mean by "figuring out what to use in place of (or before) application..."
But here is the script...
Option Explicit
Dim xlexport
Dim rowIndex
Dim Qty_Lookup
Dim Total_qty
Dim fiscal_yr
rowIndex = 1
Sub Initialize
Set xlexport = CreateObject("Excel.Application")
xlexport.Workbooks.Add
xlexport.Visible = vbTrue
fiscal_yr = datecyr(CATALOG_BIDS.BUDGETYEAR)
End Sub
Sub PageHeading
xlexport.ActiveSheet.Cells(rowIndex,"A").Value = "Product ID #"
xlexport.ActiveSheet.Cells(rowIndex,"B").Value = "Qty Ordered"
xlexport.ActiveSheet.Cells(rowIndex,"C").Value = "Unit"
xlexport.ActiveSheet.Cells(rowIndex,"D").Value = "Description"
rowIndex = rowIndex + 1
End Sub
Sub GroupHeader_CATALOG_ORDERS_PRODUCTID
Set Qty_Lookup = CreateSQLCursor
Qty_Lookup.sql = "Select sum(orderqty) qty from catalog_orders where budgetyear = '" & fiscal_yr & "' and productid = '" & CATALOG_ORDERS.PRODUCTID & "'"
Qty_Lookup.MoveNext
Total_qty = Qty_Lookup.qty
xlexport.ActiveSheet.Cells(rowIndex, "A").Value = CATALOG_ORDERS.PRODUCTID
xlexport.ActiveSheet.Cells(rowIndex, "B").Value = Total_qty
xlexport.ActiveSheet.Cells(rowIndex, "C").Value = PE_PROD_MSTR.PE_UNIT
xlexport.ActiveSheet.Cells(rowIndex, "D").NumberFormat = "@"
xlexport.ActiveSheet.Cells(rowIndex, "D").Value = PEDESC.DESC
rowIndex = rowIndex + 1
End Sub
THANKS A BUNCH!