PDA

View Full Version : [SOLVED:] Lost a Userform



Chiroman
10-20-2016, 04:45 PM
Hello,

I'm a chiropractor/acupuncturist who knows just enough VB to get me in trouble. We hired a VBA programmer to finish a huge project that I started to automate report writing and to keep costs down I've been designing the userforms and somehow lost one. I closed and reopened the document (there is more than 1 document involved) and it is nowhere to be found. I'm 95% sure that I have to redo it but that's a lot of lost time so if there's a way to get it back I'd be highly appreciative. Thanks in advance.

Richard

gmaxey
10-20-2016, 05:00 PM
If it is nowhere to be found then it is truly lost. Do you backup your files? Perhaps it was saved with a backed up file. If the future, and if you are not aware, you can export complete userforms to a file so if lost again you can import the userform back into the document or template project.

Chiroman
10-21-2016, 12:01 PM
Thanks for the reply. That's what I was afraid of. No, I didn't know that you could to that. But how does one lose a userform that's been saved?

gmaxey
10-21-2016, 01:20 PM
Typically one wouldn't. Perhaps you the file was not properly saved. I can't say. Weird things happen in Word sometimes.

Chiroman
10-21-2016, 04:05 PM
My problem is worse than I had thought. The userforms that I created have disappeared from all the project documents. Fortunately the developer has 2 of the 3 and he says I need to reinstall Word. Is there any other way? Has anyone ever heard of this happening?

gmaxey
10-21-2016, 05:36 PM
"Has anyone ever heard of this happening?" It would be hard to determine if one or more bodies out of 6 plus billion has experienced this or not. I haven't and I've been using userforms for nearly 20 years. What are these project documents? If they are not saved with .docm or .dotm extensions then they would be stripped from the saved files. Personally I don't see how reinstalling Word is going to help.

Chiroman
10-22-2016, 09:48 AM
Thanks for replying Greg. My problem is even deeper than lost userforms - I can't even get the project explorer to display. Also, I downloaded this version of Word so there is no reinstalling it as far as I can see. I'll try other forums for help or will maybe just uninstall it and buy another Word.

SamT
10-23-2016, 09:12 AM
You will have to modify these slightly, They are from my "MyPersonal xls" Excel Backup system. Since I don't really care when they were saved, just that I can tell which was last saved, I don't bother to convert DateTimes to human readable Strings. YMMV.


Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Not Me.Saved Then _
Me.SaveCopyAs ("E:\COMPUTING\VBA\MyPersonal\" & CDbl(Now) & " - Personal.xls")
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUi As Boolean, Cancel As Boolean)
Me.SaveCopyAs ("E:\COMPUTING\VBA\MyPersonal\" & CDbl(Now) & "- Personal.xls")
End Sub


I have used both BeforeClose and BeforeSave alone, with and without timestamps, and for one reason (disaster) or another the system evolved into this comprehensive double track version. You can always delete extra B/Us, but it can be impossible to recreate a corrupted file.

Chiroman
10-29-2016, 04:11 PM
Thanks for replying SamT. It turns out that the userforms were saved it's just that my version of Word 2016 doesn't recognize not only them but the whole project. Fortunately, I still have Word 2007 and everything is working fine on that so I'm good for now.