K
Kris
Hi.
I have a code which inserts some lines of code to new workbook..
Sub AddComboBoxCode2(VBCodeMod As CodeModule, sCodeName As String)
With VBCodeMod
.InsertLines .CountOfLines + 1, "Private Sub ComboBox1_Change()"
.InsertLines .CountOfLines + 1, " Dim TargetPivotTable As
PivotTable"
.InsertLines .CountOfLines + 1, " Dim units As String"
.InsertLines .CountOfLines + 1, " On Error GoTo ErrHandler"
.InsertLines .CountOfLines + 1, " Select Case ComboBox1.Value"
{...}
Everything works fine if VBA is open.
When I close VBA no code is added to workbook.
Did it happen to somebody?
I have a code which inserts some lines of code to new workbook..
Sub AddComboBoxCode2(VBCodeMod As CodeModule, sCodeName As String)
With VBCodeMod
.InsertLines .CountOfLines + 1, "Private Sub ComboBox1_Change()"
.InsertLines .CountOfLines + 1, " Dim TargetPivotTable As
PivotTable"
.InsertLines .CountOfLines + 1, " Dim units As String"
.InsertLines .CountOfLines + 1, " On Error GoTo ErrHandler"
.InsertLines .CountOfLines + 1, " Select Case ComboBox1.Value"
{...}
Everything works fine if VBA is open.
When I close VBA no code is added to workbook.
Did it happen to somebody?