Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Project - VBA Project window - Excel 2003

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Project - VBA Project window - Excel 2003

the code modules are part of the workbook, so if you close the workbook, you
close the project. Have you written the code in the Personal.xls or somewhere
other that the workbook you thought?

"Jarek Kujawa" 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Project - VBA Project window - Excel 2003


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Project - VBA Project window - Excel 2003

nope - I don't use personal.xls


ANY file behaves the way I described.

I close the file, it is closed BUT the project stays open.
I close all the files that were open and ALL of their VBA projects
remain open as if the files were still open

by double-clicking on the projects I can see all the code of any of
the files that were open


On 30 Wrz, 11:36, Patrick Molloy
wrote:
the code modules are part of the workbook, so if you close the workbook, you
close the project. Have you written the code in the Personal.xls or somewhere
other that the workbook you thought?



"Jarek Kujawa" 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- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


  #5   Report Post  
Posted to microsoft.public.excel.programming
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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Project - VBA Project window - Excel 2003


You might have to add a reference to Microsoft Visual Basic For
Applications Extensions -x.x (where x.x is the version number)- from the
reference library found in the VBEToolsReferences

Jarek Kujawa;508069 Wrote:
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' ('The Code Cage - Microsoft Office Help'

(http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile:'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread:'Project - VBA Project window - Excel 2003 - The

Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...d.php?t=139660)



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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Project - VBA Project window - Excel 2003

should I do that for any file?

cause I did that for several of them and to no avail

after restarting Excel and re-opening the files the library was not
added



On 30 Wrz, 13:35, Simon Lloyd
wrote:
You might have to add a reference to Microsoft Visual Basic For
Applications Extensions -x.x (where x.x is the version number)- from the
reference library found in the VBEToolsReferences

Jarek Kujawa;508069 Wrote:





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' ('The Code Cage - Microsoft Office Help'

(http://www.thecodecage.com))


------------------------------------------------------------------------
Simon Lloyd's Profile:'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread:'Project - VBA Project window - Excel 2003 - The

Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...d.php?t=139660)


--
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....php?t=139660- Ukryj cytowany tekst -

- Poka¿ cytowany tekst -


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Project - VBA Project window - Excel 2003

thks

but not always

apparently

On 30 Wrz, 11:36, Patrick Molloy
wrote:
so if you close the workbook, you
close the project



"Jarek Kujawa" 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- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Project - VBA Project window - Excel 2003


I''ve seen that from time to time. I think it is a bug in the VBA
editor. Fortunately, it is harmless and you can safely ignore it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

On Wed, 30 Sep 2009 02:14:24 -0700 (PDT), Jarek Kujawa
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

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Project - VBA Project window - Excel 2003

thanks a lot Chip
I am an addicted reader of your site
;-)
I am trying ignore that bug but it is a bit annoying when trying to
test/introduce changes into the code
I just have too many same VBAProjects to choose from
;-)
I thought there is a way to get rid of it somehow
thanks for your feedback

On 30 Wrz, 15:14, Chip Pearson wrote:
I''ve seen that from time to time. I think it is a bug in the VBA
editor. Fortunately, it is harmless and you can safely ignore it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
* * Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLCwww.cpearson.com
(email on web site)

On Wed, 30 Sep 2009 02:14:24 -0700 (PDT), Jarek Kujawa



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- Ukryj cytowany tekst -


- Poka¿ cytowany tekst -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel:VB properties window will not open; project explorer is ok DJ Excel Programming 0 December 2nd 08 04:33 PM
Docking Project Explorer, Properties window and Code window in VBE jayray Setting up and Configuration of Excel 2 March 27th 07 04:42 PM
With VBA from Excel: Open Project, extract resource list and copy it to a worksheet, close project. Tony Excel Programming 1 October 18th 05 03:53 PM
Project still in "project explorer" window after file closed down! Gunnar Johansson Excel Programming 16 December 22nd 04 06:21 PM
Project still in "project explorer" window after file closed down! Gunnar Johansson[_3_] Excel Programming 0 December 7th 04 01:43 PM


All times are GMT +1. The time now is 06:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"