R@emdonck
Dec 13th, 1999, 06:30 AM
Hi,
How do I change the back color of an Excell cell and the color of the text in an Excell cell?
R@emdonck
MyCode:
Public Sub stored_procedure_b2()
Const xlExcel5 = 39
Dim XLS As Object ' for the application
Dim XLSheet As Object ' for the worksheet
Set XLS = CreateObject("Excel.Application")
' To Open an existing workbook
XLS.Workbooks.Open ("C:\Shiftverslag\B2 Usage Report1.xls")
' Open the Worksheet named "Input"
Set XLSheet = XLS.Worksheets("Input")
' Set Column Names
XLSheet.Cells(6, 2) = (str_date + (6 / 24)) 'date
'Open the Worksheet named "plan"
Set XLSheet = XLS.Worksheets("plan")
'set new colors
???????????????????????????
'print
XLSheet.PrintOut
' Don't save
XLSheet.Parent.Saved = True
' DO NOT forget to quit the excel app and also to release the objects...
XLSheet.Application.Quit
' Release the Excel object variables
Set XLSheet = Nothing
Set XLS = Nothing
End Sub
How do I change the back color of an Excell cell and the color of the text in an Excell cell?
R@emdonck
MyCode:
Public Sub stored_procedure_b2()
Const xlExcel5 = 39
Dim XLS As Object ' for the application
Dim XLSheet As Object ' for the worksheet
Set XLS = CreateObject("Excel.Application")
' To Open an existing workbook
XLS.Workbooks.Open ("C:\Shiftverslag\B2 Usage Report1.xls")
' Open the Worksheet named "Input"
Set XLSheet = XLS.Worksheets("Input")
' Set Column Names
XLSheet.Cells(6, 2) = (str_date + (6 / 24)) 'date
'Open the Worksheet named "plan"
Set XLSheet = XLS.Worksheets("plan")
'set new colors
???????????????????????????
XLSheet.PrintOut
' Don't save
XLSheet.Parent.Saved = True
' DO NOT forget to quit the excel app and also to release the objects...
XLSheet.Application.Quit
' Release the Excel object variables
Set XLSheet = Nothing
Set XLS = Nothing
End Sub