ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Project - VBA Project window - Excel 2003 (https://www.excelbanter.com/excel-programming/434315-project-vba-project-window-excel-2003-a.html)

Jarek Kujawa[_2_]

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

Patrick Molloy[_2_]

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


Simon Lloyd[_1259_]

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


Jarek Kujawa[_2_]

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 -



Jarek Kujawa[_2_]

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



Simon Lloyd[_1261_]

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


Jarek Kujawa[_2_]

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 -



Jarek Kujawa[_2_]

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 -



Chip Pearson

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


Jarek Kujawa[_2_]

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 -




All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com