Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
When I save a workbook that have just created and reopen it all of my
VBA code that I wrote is gone. I've been doing this for years and I've never had this problem until now. I've checked all of the options I can think of and I can't find anything that would affect saving macros. I can change the cell contents on a sheet and I can see those changes after saving, closing, and reopening so why are my macros not saved? I'm using Excel 2003. I don't have this problem on other machines with the same version so it appears that it might be isolated to my machine. Suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
Brian, I have a workbook that has the same problem. Here's how I've worked
around it: - Launch Excel, goto the VBE, the General tab of Tools | Options and make sure that Notify Before State Loss is checked. - Open your workbook. - Go to the VBE and open up some code module in your project. - Now do something to reset your project. What I do is to Cut the Option Explicit out of my program. If you are successful in resetting the project you will get a prompt confirming the reset of the project. Say OK to the prompt. - Now Paste back your Option Explicit and perform a Debug | Compile of your project. - Now try to save workbook. Its a pain in the butt to have to do this each time, but that's where I'm at. I'm guessing this problem is caused by workbook size. Hope this works for you. josh |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
HI Brian
JUst a random thought on this..are you perhapes saving the macros in your personal.xls file rather than with the "this woprkbook " option ? Best N10 "Brian Gideon" wrote in message oups.com... When I save a workbook that have just created and reopen it all of my VBA code that I wrote is gone. I've been doing this for years and I've never had this problem until now. I've checked all of the options I can think of and I can't find anything that would affect saving macros. I can change the cell contents on a sheet and I can see those changes after saving, closing, and reopening so why are my macros not saved? I'm using Excel 2003. I don't have this problem on other machines with the same version so it appears that it might be isolated to my machine. Suggestions? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
Have you used Rob Bovey's VBA Code Cleaner on this workbook? Sounds like it
may be corrupted, in which case, all sorts of disasters could befall you/it. On Thu, 21 Oct 2004 10:36:05 -0600, "Josh Sale" <jsale@tril dot cod wrote: Brian, I have a workbook that has the same problem. Here's how I've worked around it: - Launch Excel, goto the VBE, the General tab of Tools | Options and make sure that Notify Before State Loss is checked. - Open your workbook. - Go to the VBE and open up some code module in your project. - Now do something to reset your project. What I do is to Cut the Option Explicit out of my program. If you are successful in resetting the project you will get a prompt confirming the reset of the project. Say OK to the prompt. - Now Paste back your Option Explicit and perform a Debug | Compile of your project. - Now try to save workbook. Its a pain in the butt to have to do this each time, but that's where I'm at. I'm guessing this problem is caused by workbook size. Hope this works for you. josh |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
Josh,
Thanks for the reply. While I was going through your suggested procedure I discovered (by accident) that if I create a new module and put the code in there then it will save correctly. The code is lost if I put it in Sheet1, Sheet2, Sheet3, or ThisWorkbook, etc. despite the fact that it can be executed and debugged without problems. I'm still not exactly sure what's going on, but at least I have a work-around for now. Thanks. Brian |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
Creating a new module probably resets the project.
"Brian Gideon" wrote in message oups.com... Josh, Thanks for the reply. While I was going through your suggested procedure I discovered (by accident) that if I create a new module and put the code in there then it will save correctly. The code is lost if I put it in Sheet1, Sheet2, Sheet3, or ThisWorkbook, etc. despite the fact that it can be executed and debugged without problems. I'm still not exactly sure what's going on, but at least I have a work-around for now. Thanks. Brian |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA macro does not save
I fixed my problem and I thought I'd share the solution in case someone
googled and found this thread. It seems that my profile was corrupted. I rebooted my machine and logged in using a different username with administrative privileges and deleted the profile associated with my username by going into Control Panel | System | Advanced tab | User Profiles Settings. The next time you log in WinXP will create a new profile. Remember that you will of course lose all profile specific settings, data, and documents so be sure to backup anything that is important. Brian Brian Gideon wrote: When I save a workbook that have just created and reopen it all of my VBA code that I wrote is gone. I've been doing this for years and I've never had this problem until now. I've checked all of the options I can think of and I can't find anything that would affect saving macros. I can change the cell contents on a sheet and I can see those changes after saving, closing, and reopening so why are my macros not saved? I'm using Excel 2003. I don't have this problem on other machines with the same version so it appears that it might be isolated to my machine. Suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Macro to Save without the Save Message | Excel Discussion (Misc queries) | |||
Macro Save As | Excel Discussion (Misc queries) | |||
Save As macro | Excel Programming | |||
Prompted to save changes after macro save - why? | Excel Programming |