9 Replies Latest reply: Sep 29, 2016 8:56 AM by albert harari RSS

    Automator post script error "Compile Error: ErrorCodeDomCompilerError Number:BC30430, Line:67, ErrorText:'End Function' must be preceded by a matching 'Function'. "

    albert harari

      first time playing around with post scripts in automator. I recorded a macro in excel of what I wanted to happen to the spreadsheet after it was run then copied and pasted the VBA into the automator post script module of the project. I have no experience coding VBA so this was really the only way I could think of to get two measure fields from within my summary to move before the detail columns of the summary. how can I make this work?

       

      I get the below error:

       

      Compile Error: ErrorCodeDomCompilerError Number:BC30430, Line:67, ErrorText:'End Function' must be preceded by a matching 'Function'.


      here was the VBA from the macro:

       

      Sub cdallolog()
      '
      ' cdallolog Macro
      '

      '
          ActiveWindow.ScrollColumn = 2
          ActiveWindow.ScrollColumn = 3
          ActiveWindow.ScrollColumn = 4
          ActiveWindow.ScrollColumn = 5
          ActiveWindow.ScrollColumn = 6
          ActiveWindow.ScrollColumn = 7
          ActiveWindow.ScrollColumn = 8
          ActiveWindow.ScrollColumn = 9
          ActiveWindow.ScrollColumn = 10
          ActiveWindow.ScrollColumn = 11
          ActiveWindow.ScrollColumn = 12
          ActiveWindow.ScrollColumn = 13
          ActiveWindow.ScrollColumn = 14
          ActiveWindow.ScrollColumn = 15
          ActiveWindow.ScrollColumn = 16
          ActiveWindow.ScrollColumn = 17
          ActiveWindow.ScrollColumn = 18
          ActiveWindow.ScrollColumn = 19
          ActiveWindow.ScrollColumn = 20
          ActiveWindow.ScrollColumn = 21
          ActiveWindow.ScrollColumn = 22
          ActiveWindow.ScrollColumn = 23
          Columns("AH:AI").Select
          Range("AI1").Activate
          Selection.Cut
          ActiveWindow.ScrollColumn = 22
          ActiveWindow.ScrollColumn = 21
          ActiveWindow.ScrollColumn = 20
          ActiveWindow.ScrollColumn = 19
          ActiveWindow.ScrollColumn = 18
          ActiveWindow.ScrollColumn = 14
          ActiveWindow.ScrollColumn = 12
          ActiveWindow.ScrollColumn = 11
          ActiveWindow.ScrollColumn = 10
          ActiveWindow.ScrollColumn = 8
          ActiveWindow.ScrollColumn = 7
          ActiveWindow.ScrollColumn = 6
          ActiveWindow.ScrollColumn = 5
          ActiveWindow.ScrollColumn = 4
          ActiveWindow.ScrollColumn = 3
          ActiveWindow.ScrollColumn = 2
          ActiveWindow.ScrollColumn = 1
          Columns("C:C").Select
          Selection.Insert Shift:=xlToRight
          Range("E13").Select
      End Sub