Close VBA Project

  • Thread starter Thread starter tcb
  • Start date Start date
T

tcb

I am creating a command button then adding code with this syntax.

With objActiveWkb.VBProject.VBComponents("Sheet1").CodeModule
StartLine = .CreateEventProc("Click", strButtonName) + 1
.InsertLines StartLine, _
" Sheets(" & """" & rsCoverSheet!TabName & """" &
").Select" & vbCrLf
End With

The spreadsheet is created, the button is created, the code is
created, the spreadsheet is saved and closed.

But the "Microsoft Visual Basic - VBA Project" remains open. What is
the syntax to close it?
 
It's a long time peculiarity of the VBE that it does not always seem to know
that a given project's workbook has been closed. It's annoying but it does
no harm as far as I know.

--
Jim
|I am creating a command button then adding code with this syntax.
|
| With objActiveWkb.VBProject.VBComponents("Sheet1").CodeModule
| StartLine = .CreateEventProc("Click", strButtonName) + 1
| .InsertLines StartLine, _
| " Sheets(" & """" & rsCoverSheet!TabName & """" &
| ").Select" & vbCrLf
| End With
|
| The spreadsheet is created, the button is created, the code is
| created, the spreadsheet is saved and closed.
|
| But the "Microsoft Visual Basic - VBA Project" remains open. What is
| the syntax to close it?
 
Back
Top