Hi AHK World
I try to chance the font ,color,size,color background.wth COM.
This is the code From VB (Excel macro recorder)
Range("A1:O1").Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 49407 .TintAndShade = 0 .PatternTintAndShade = 0 End With With Selection.Font .ThemeColor = xlThemeColorLight2 .TintAndShade = 0.399975585192419 End With With Selection.Font .Name = "Calibri" .Size = 16 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorLight2 .TintAndShade = 0.399975585192419 .ThemeFont = xlThemeFontMinor End With With Selection.Font .Name = "Arial" .Size = 16 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ThemeColor = xlThemeColorLight2 .TintAndShade = 0.399975585192419 .ThemeFont = xlThemeFontNone End With Cells.Select Cells.EntireColumn.AutoFit End Sub
this is the code from AHK
oExcel := ComObjCreate("Excel.Application") oExcel.WorkBooks.Add oExcel.Visible := true sleep 3000 oExcel.Range("a1").Value := "Fecha" oExcel.Range("b1").Value := "hora" oExcel.Range("c1").Value := "serial" oExcel.Range("d1").Value := "tipo" oExcel.Range("e1").Value := "naed" oExcel.Range("F1").Value := "FALLA" oExcel.Range("g1").Value := "defecto" oExcel.Range("h1").Value := "linea" oExcel.Range("i1").Value := "FALLA1" oExcel.Range("j1").Value := "texto" oExcel.Range("k1").Value := "componente" oExcel.Range("l1").Value := "comentario" oExcel.Range("m1").Value := "turno" oExcel.Range("n1").Value := "numero" oExcel.Range("o1").Value := "tipo 2" sleep 3000 oExcel.Range("A1:O1").Select oExcel.Selection.Interior oExcel.Pattern = xlSolid oExcel.PatternColorIndex = xlAutomatic oExcel.Color = 15773696 oExcel.TintAndShade = 0 oExcel.PatternTintAndShade = 0
but appear this error
C:\Users\dario\Desktop\New folder (2)\New AutoHotkey Script (2).ahk (25) : ==> This line does not contain a recognized action.
Specifically: oExcel.Pattern = xlSolid
someone know how can I fixed?
thanks in advance