Thanks for your posting and using Aspose.Cells for .NET.
Please see the following code segment. It sets the fill color of the cell C3 as green. You can convert the following code into VB script for your needs.
Please also see the following documentation article relating to using Aspose.Cells in VB script
How do I set the stl1.ForegoundColor from the document you have attached explaining vbscript?
See hightlighted text below...
Dim Workbook Set Workbook = CreateObject("Aspose.Cells.Workbook") Dim sheet Set sheet = Workbook.Worksheets.Item(0) Dim cells Set cells = sheet.cells Dim cell1 Set cell1 = cells.Item_2(0, 0) Call cell1.PutValue_5("Testing...") Dim cell2 Set cell2 = cells.Item_2(4, 2) Call cell2.PutValue_3(100) 'methods Dim methods Set methods = CreateObject("EagleCW.Methods") Dim strTest As String strTest = methods.AsposeTestString() MsgBox (strTest)
'Define style and specify attributes Dim stl1 Set stl1 = cell1.Style stl1.Font.Name = "Courier New" stl1.Font.IsBold = True stl1.ForegroundColor = ?????? Dim stlflag Set stlflag = CreateObject("Aspose.Cells.StyleFlag") stlflag.All = True stlflag.FontBold = True stlflag.FontName = True 'Define range of cells Dim range Set range = cells.CreateRange("A1", "C5") range.Name = "MyRange" 'Apply style to the range: A1:C5 Call range.ApplyStyle((stl1), (stlflag)) 'Apply style to the first row Call cells.ApplyRowStyle(0, (stl1), (stlflag)) 'Apply style to the first column: A Call cells.ApplyColumnStyle((0), (stl1), (stlflag)) Call Workbook.Save_4("c:\testing\vbsTest.xls")Dim Workbook Set Workbook = CreateObject("Aspose.Cells.Workbook") Dim sheet Set sheet = Workbook.Worksheets.Item(0) Dim cells Set cells = sheet.cells Dim cell1 Set cell1 = cells.Item_2(0, 0) Call cell1.PutValue_5("Testing...") Dim cell2 Set cell2 = cells.Item_2(4, 2) Call cell2.PutValue_3(100) 'methods Dim methods Set methods = CreateObject("EagleCW.Methods") Dim strTest As String strTest = methods.AsposeTestString() MsgBox (strTest)
'Define style and specify attributes Dim stl1 Set stl1 = cell1.Style stl1.Font.Name = "Courier New" stl1.Font.IsBold = True stl1.ForegroundColor = ?????? Dim stlflag Set stlflag = CreateObject("Aspose.Cells.StyleFlag") stlflag.All = True stlflag.FontBold = True stlflag.FontName = True 'Define range of cells Dim range Set range = cells.CreateRange("A1", "C5") range.Name = "MyRange" 'Apply style to the range: A1:C5 Call range.ApplyStyle((stl1), (stlflag)) 'Apply style to the first row Call cells.ApplyRowStyle(0, (stl1), (stlflag)) 'Apply style to the first column: A Call cells.ApplyColumnStyle((0), (stl1), (stlflag)) Call Workbook.Save_4("c:\testing\vbsTest.xls")
We have logged your issue for investigation in our database. We will look into it and provide you a sample code if possible. Please spare us some time. Once, we will have some update for you, we will let you know asap.
We have logged your comments in our database against this issue. We will look into it and advise you. Once, there is some update for you, we will let you know asap.
I have evaluated your scenario/case configuring Classic Asp on IIS. Please see the following sample code that works fine as I tested on my pc. Please refer to the code segment below that runs fine and the output file is generated fine on my end. I have applied blue color as cells shading color for a range and a whole row. I have also attached the output file for your reference.
Sample code:
Test.asp page :
<%@ LANGUAGE = VBScript %>
<% Option Explicit %>
Aspose.Cells classical ASP sample
<%
'Create a Workbook object
Dim xls
Set xls = CreateObject(“Aspose.Cells.Workbook”)
'Put data into the workbook
Dim sheet
'Get the first worksheet (default worksheet)
Set sheet = xls.worksheets.item(0)
Dim cells
Set cells = sheet.cells
Dim cell
Set cell = cells.item_3(“A1”)
cell.PutValue “Column1”
'Define style and specify attributes
Dim stl1
set stl1= cell.GetStyle
stl1.Font.Name = "Courier New"
stl1.Font.IsBold = True
’Set the blue color as fill color for cell(s)
stl1.ForegroundArgbColor = 255
’Set the pattern as solid background type
stl1.Pattern = 1
Dim stlflag
set stlflag = CreateObject(“Aspose.Cells.StyleFlag”)