Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default 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   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Macro Save As John Excel Discussion (Misc queries) 1 June 1st 06 12:44 PM
Save As macro tjgriffi Excel Programming 1 January 5th 04 12:14 AM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


All times are GMT +1. The time now is 12:26 PM.

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

About Us

"It's about Microsoft Excel"