Что нового

Из VBA Excel в Autoit

andriy111

Новичок
Сообщения
58
Репутация
0
Привет Всем!
Замучился уже експериментировать...
может кто-нибудь поможет сделать из 'того чуда autoit

Код:
Sub Setka()

    Range("A1:V17").Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
End Sub

Начало есть а вот дальше...
Код:
#include <Excel.au3>
Local $oExcel = _ExcelBookNew()
$oExcel.Range("A1:V17").Select

Жду ответа! Спасибо!
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
andriy111,
Код:
#include <Excel.au3>

$oExcel = _ExcelBookNew()

For $i = $xlEdgeLeft To $xlInsideHorizontal
	$oExcel.Range('A1:D3').Borders($i).LineStyle = $xlContinuous
Next

Или так, с доп. опциями.
Код:
#include <Excel.au3>

Global Const $xlDash = 4

$oExcel = _ExcelBookNew()
$oRange = $oExcel.Range('A1:V22')
For $i = $xlEdgeLeft To $xlInsideHorizontal
	With $oRange.Borders($i)
		.LineStyle = $xlDash
		.Weight = $xlMedium
		.ColorIndex = 5
	EndWith
Next
$oRange.Interior.ColorIndex = 36
$oRange.Font.ColorIndex = 3
 
Верх