Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creating excel file, adding code to it from code, VBE window stays
Hello,
MS ACCESS/EXCEL 2003 on XP PRO. I have an access database that creates/exports and excel file/application. After the file is exported, the VBA in access adds a module and event procedures to the excel file. This works well so far, but while the excel application closes at the end, the VBE (Visual Basic Editor "Code Window") window stays open. This is a problem. Does anyone have any idea how to close the VBE window using code, or to close out the project so the window closes, etc? Thanks. Below is some snippets of the code to give you an idea of some of the syntax I'm using. '''''''''''''''''' 'Begin Code'''' '''''''''''''''''''''''''' Dim vba_editor As VBIDE.VBE Dim vbp_access, vbp_excel As VBIDE.VBProject Dim vbp_comp As VBIDE.VBComponent Dim vbp_code As VBIDE.CodeModule Dim obj_button As OLEObject Dim lng_line As Long Dim str_module As String '<<<<<<<<<<< str_wkb = str_file & str_extension Set app_xls = Excel.Application Set vbp_excel = app_xls.Workbooks(str_wkb).VBProject '<<<<<<<<<<< Set vbp_comp = vbp_excel.VBComponents.Add(vbext_ct_StdModule) vbp_comp.Name = "C1000ToolKit" '<<<<<<<<<<< Set obj_button = app_xls.Sheets("Control_Panel").OLEObjects.Add(Cla ssType:="Forms.CommandButton.1", Left:=20, Top:=int_top, Height:=20, Width:=80) '<<<<<<<<<<< Set vbp_code = vbp_comp.CodeModule '<<<<<<<<<<< With vbp_code .InsertLines l, str_module End With Thanks once again. -- BlueWolverine MSE - Mech. Eng. Go BLUE! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting all code in new file only (creating using save as) | Excel Programming | |||
VBA line of code executes in Immediate Window but not in Code Window | Excel Discussion (Misc queries) | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Seting a Constant (via code) when creating a new file based on a template | Excel Programming | |||
Import VBA Code in Excel-File ? (Export VBA Code to file) | Excel Programming |