본문 바로가기
TechNical/Windows

엑셀 메크로에서 박스 그리기

by 강멍멍이 2019. 6. 4.
반응형
원래 만든건 450라인 짜리 값을 읽어서 흐름도를 그리는건데  쓰기 힘들어서 일단 핵심만.. 포스팅                                                                                                      

Dim ws As Worksheet
Set ws = Worksheets(ActiveSheet.Name)
Set CondBox = ws.Shapes.AddShape(msoShpeRoundedRectangle, stXPos, stYPos, 100, 50)
With CondBox
  .Name = "CondBox"
  .Fill.ForeColor.RGB = RGB(250,250,250)
  .Line.ForColor.RGB = RGB(0,0,0)
  .Line.Weight = 1
  .Adjustments.Item(1) = 0.5
  .TextFrame.Characters.Font.Color = 1
  .TextFrame.Characters.Font.Size = 8
  .TextFrame.Characters.Font.Text = "hello"
End With



LineType = msoConnectorElbow
stdir = 1
enddir = 3
Set conntor = ws.Shapes.AddConnector(LineType, 50, 50, 50, 50)
With conntor
  .Name = "Line1"
  .Line.EndArrowheadStyle = msoArrowheadTriangle
  .ConnectorFormat.BeginConnect ws.Shapes("BoxName"), stDir
  .ConnectorFormat.EndConnect ws.Shapes("BoxNam2"), EndDir
End With
반응형

댓글