Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel:VB properties window will not open; project explorer is ok | Excel Programming | |||
Docking Project Explorer, Properties window and Code window in VBE | Setting up and Configuration of Excel | |||
With VBA from Excel: Open Project, extract resource list and copy it to a worksheet, close project. | Excel Programming | |||
Project still in "project explorer" window after file closed down! | Excel Programming | |||
Project still in "project explorer" window after file closed down! | Excel Programming |