View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jarek Kujawa[_2_] Jarek Kujawa[_2_] is offline
external usenet poster
 
Posts: 896
Default Project - VBA Project window - Excel 2003

thks Simon

1. "Method 'VBProject' of object '_Workbook' failed" is what I'm
getting

2. am afraid this does not do what I am looking for - if I open/close
the same file several times I can see 'all' (the same) several
VBPRojects in VBE window


On 30 Wrz, 11:47, Simon Lloyd
wrote:
You can close the VBE Automatically like this:
Code:
--------------------
* * Private Sub Workbook_BeforeClose(Cancel As Boolean)
* Set MyVBe = ThisWorkbook.VBProject
* If MyVBe.Mode = vbext_vm_Run Then
* MyVBe.VBE.MainWindow.Visible = False
* End If
* End Sub
--------------------

Jarek Kujawa;508001 Wrote:

Hi,


1. I open a file, write some code, then close the file


2. even though the file was closed it's code is still viewable in
Project - VBA Project window, as if the file was still open


the only way I know to have the file REALLY closed in Project - VBA
Project window is to Exit and re-start Excel


does anyone know a better way?


TIA


--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile:http://www.thecodecage.com/forumz/member.php?userid=1
View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=139660