6 Replies Latest reply on Apr 22, 2014 9:33 AM by Larry G. Schneider

    Creating shapes using SetEntirePath

    joptimus

      Hi guys,

       

      I've been trying unsuccessfully to create lines using data from Excel by using the SetEntirePath method. I just cannot figure out the correct syntax.

       

      The template I was starting from is this Excel VBA macro:

      Sub generateshape()
          Dim iapp As New Illustrator.Application
          Dim idoc As Illustrator.Document

          Dim isquare As Illustrator.PathItem

          Set idoc = iapp.ActiveDocument

          Set isquare = idoc.PathItems.Rectangle(200, 200, 100, 100)
         
          Set isquare = Nothing
          Set idoc = Nothing
          Set iapp = Nothing

      End Sub

       

      But I don't want to create a square but simply a line by using data from cells in Excel. How do I do that? I always get an "argument is not optional" error when using for example:

      Dim ipath As Illustrator.PathItem

      (...)

      Set ipath.SetEntirePath = ([[0, 0], [100, 100]])

       

      Thanks!