#1   Report Post  
Losse
 
Posts: n/a
Default Deleted Macros?


I was messing around in Excel and accidentally deleted all of my macros
I think. I used:

Application.DisplayAlerts=False
ThisWorkbook.ChangeFileAccess xlReadOnly
Kill ThisWorkbook.FullName
ThisWorkbook.Close False

Is there anyway I can get them back?


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #2   Report Post  
dominicb
 
Posts: n/a
Default


Good evening Losse

Unfortunately it won't be simple, unless you had a back-up. As you
have discovered, the kill command is a bit more brutal than pressing
delete from Windows - which sends a file to the recycle bin.

However, all is not lost, because you have deleted the file, not
removed the macro and saved the macro-free file back over itself. You
may be able to recover the file using an undelete utility. Try
searching Google for just that.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #3   Report Post  
Losse
 
Posts: n/a
Default


I see only expensive programs for undeleting corrupted macros. Were mine
simply corrupted or were they deleted?


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #4   Report Post  
dominicb
 
Posts: n/a
Default


Hi Losse

Your macros are saved as part of the file. The file has been deleted,
therefore the contents of the file and your macros have gone. If you
can undelete the file - and programs are available that will do this -
your data and macros can be recovered intact.

http://www.google.co.uk/search?hl=en... are%22&meta=

this link is a Google page searching for freeware undelete utilities.
I haven't used an undelete facility since Nuts'n'Bolts was available,
so can't recommend one. You could try asking here for a good freeware
utility (unless someone reading this forum can recommend one...?):

http://www.computerforum.com/forumdisplay.php?f=17

Good luck

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #5   Report Post  
Losse
 
Posts: n/a
Default


I belive I killed "Book1." How am I supposed to find this? It was never
saved, and that is the default name to Excel worksheets.


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932



  #6   Report Post  
Losse
 
Posts: n/a
Default


My macros were all saved to the PERSONAL.XLS anyways...


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #7   Report Post  
Losse
 
Posts: n/a
Default


I tried using the Restoration program, but I have no idea what name to
search for.


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #8   Report Post  
Dave Peterson
 
Posts: n/a
Default

If it was never saved, then you couldn't have "killed" it (kill deletes a file
on disk).

But since that code closed the workbook, too, it's gone and so are the macros in
it.




Losse wrote:

I belive I killed "Book1." How am I supposed to find this? It was never
saved, and that is the default name to Excel worksheets.

--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932


--

Dave Peterson
  #9   Report Post  
Dave Peterson
 
Posts: n/a
Default

If your macros were in personal.xls and you remembered to save personal.xls when
you closed excel, then they should still be there.

If they're not, I bet you said no to updating personal.xls.



Losse wrote:

My macros were all saved to the PERSONAL.XLS anyways...

--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932


--

Dave Peterson
  #10   Report Post  
Losse
 
Posts: n/a
Default


My macros are normally saved to the PERSONAL.XLS. I tried to recover it
using the Restoration program, but it couldn't find it. Is there really
nothing I can do? I spent weeks perfecting and building those macros...


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932



  #11   Report Post  
Dave Peterson
 
Posts: n/a
Default

Does that mean you can't find personal.xls or you can't find the new macros in
personal.xls?

If you can find personal.xls, but the new macros are gone, then they're gone.

If you can't find personal.xls, then maybe using windows start button|search
(look through hidden folders and for hidden files--just in case) may help.

If you ran this code from personal.xls project, I hope you have a backup.
Because I think you're out of luck.

Application.DisplayAlerts=False
ThisWorkbook.ChangeFileAccess xlReadOnly
Kill ThisWorkbook.FullName
ThisWorkbook.Close False

====
Remember to backup personal.xls (or any other file) before you start
experimenting. (too late for this time, though.)

Losse wrote:

My macros are normally saved to the PERSONAL.XLS. I tried to recover it
using the Restoration program, but it couldn't find it. Is there really
nothing I can do? I spent weeks perfecting and building those macros...

--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932


--

Dave Peterson
  #12   Report Post  
Losse
 
Posts: n/a
Default


That's correct. The PERSONAL.XLS is gone completely. Yes, I did run code
from a macro in the PERSONAL.XLS. Why would it have killed the macros
instead of book1? I have no idea why killing the current file would
have deleted all of my macros.


--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932

  #13   Report Post  
Dave Peterson
 
Posts: n/a
Default

Your code:

Application.DisplayAlerts=False
ThisWorkbook.ChangeFileAccess xlReadOnly
Kill ThisWorkbook.FullName
ThisWorkbook.Close False

ThisWorkbook means the workbook that contains the code.

If only you had used Activeworkbook!



Losse wrote:

That's correct. The PERSONAL.XLS is gone completely. Yes, I did run code
from a macro in the PERSONAL.XLS. Why would it have killed the macros
instead of book1? I have no idea why killing the current file would
have deleted all of my macros.

--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=386932


--

Dave Peterson
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
Protect macros? JulieD Excel Discussion (Misc queries) 6 August 25th 05 08:38 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 07:20 PM
Macros disappear after a file is imported Brent E Excel Discussion (Misc queries) 1 December 18th 04 12:25 AM


All times are GMT +1. The time now is 05:43 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"