Close VBA Project

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?
 
J

Jim Rech

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top