PC Review


Reply
Thread Tools Rate Thread

Backup Addin

 
 
Robin Clay
Guest
Posts: n/a
 
      11th Nov 2008
Greetings !

I have this little routine in my AddIn, to save it on exit - Gord Dibben may
recognise this (for which, thanks again)

But as well as saving the AddIn, I would like to save a copy of it. But
this doesn't work....
-----------------
Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim Msg, Ans, myDate, MyNew

With ActiveWorkbook
Msg = "Do You Want Save Changes to " _
& Me.Name & "?"
Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
Select Case Ans
Case vbYes
Me.Save
myDate = Mid(Me.UserStatus(1, 2), 7, 4) _
& Mid(Me.UserStatus(1, 2), 4, 2) _
& Mid(Me.UserStatus(1, 2), 1, 2) _
& Mid(Me.UserStatus(1, 2), 12, 2) _
& Mid(Me.UserStatus(1, 2), 15, 2)
MyNew = Left(Me.Name, Len(Me.Name) - 4) _
& " " & myDate _
& ".xla"
FileCopy Me.Name = MyNew '<-------- doesn't work !
Case vbNo
Me.Saved = True
Case vbCancel
Cancel = True
Exit Sub
End Select
End With
End Sub
-----------------

Regards

Robin
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      11th Nov 2008
Try savecopyas

Me.SaveCopyAs MyNew


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Robin Clay" <Robin_B DOT Clay AT virgin DOT net> wrote in message
news:A45B7A6B-25B8-4D2F-BBC3-(E-Mail Removed)...
> Greetings !
>
> I have this little routine in my AddIn, to save it on exit - Gord Dibben
> may
> recognise this (for which, thanks again)
>
> But as well as saving the AddIn, I would like to save a copy of it. But
> this doesn't work....
> -----------------
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
>
> Dim Msg, Ans, myDate, MyNew
>
> With ActiveWorkbook
> Msg = "Do You Want Save Changes to " _
> & Me.Name & "?"
> Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
> Select Case Ans
> Case vbYes
> Me.Save
> myDate = Mid(Me.UserStatus(1, 2), 7, 4) _
> & Mid(Me.UserStatus(1, 2), 4, 2) _
> & Mid(Me.UserStatus(1, 2), 1, 2) _
> & Mid(Me.UserStatus(1, 2), 12, 2) _
> & Mid(Me.UserStatus(1, 2), 15, 2)
> MyNew = Left(Me.Name, Len(Me.Name) - 4) _
> & " " & myDate _
> & ".xla"
> FileCopy Me.Name = MyNew '<-------- doesn't work !
> Case vbNo
> Me.Saved = True
> Case vbCancel
> Cancel = True
> Exit Sub
> End Select
> End With
> End Sub
> -----------------
>
> Regards
>
> Robin



 
Reply With Quote
 
Robin Clay
Guest
Posts: n/a
 
      11th Nov 2008
Thank you !
--
Regards

Robin


"Bob Phillips" wrote:

> Try savecopyas
>
> Me.SaveCopyAs MyNew
>
>
> --
> HTH
>
> Bob
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
> "Robin Clay" <Robin_B DOT Clay AT virgin DOT net> wrote in message
> news:A45B7A6B-25B8-4D2F-BBC3-(E-Mail Removed)...
> > Greetings !
> >
> > I have this little routine in my AddIn, to save it on exit - Gord Dibben
> > may
> > recognise this (for which, thanks again)
> >
> > But as well as saving the AddIn, I would like to save a copy of it. But
> > this doesn't work....
> > -----------------
> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
> >
> > Dim Msg, Ans, myDate, MyNew
> >
> > With ActiveWorkbook
> > Msg = "Do You Want Save Changes to " _
> > & Me.Name & "?"
> > Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
> > Select Case Ans
> > Case vbYes
> > Me.Save
> > myDate = Mid(Me.UserStatus(1, 2), 7, 4) _
> > & Mid(Me.UserStatus(1, 2), 4, 2) _
> > & Mid(Me.UserStatus(1, 2), 1, 2) _
> > & Mid(Me.UserStatus(1, 2), 12, 2) _
> > & Mid(Me.UserStatus(1, 2), 15, 2)
> > MyNew = Left(Me.Name, Len(Me.Name) - 4) _
> > & " " & myDate _
> > & ".xla"
> > FileCopy Me.Name = MyNew '<-------- doesn't work !
> > Case vbNo
> > Me.Saved = True
> > Case vbCancel
> > Cancel = True
> > Exit Sub
> > End Select
> > End With
> > End Sub
> > -----------------
> >
> > Regards
> >
> > Robin

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook backup addin and W7 wtdrm Microsoft Outlook Discussion 3 13th Apr 2010 09:35 PM
MS OL Backup Addin DL Microsoft Outlook Discussion 3 16th Mar 2010 03:39 PM
Outlook .pst backup addin Jim Brown Microsoft Outlook Third-Party Utilities 4 28th Jun 2005 08:51 PM
Outlook and Backup addin Ken Microsoft Outlook 4 22nd Mar 2004 10:01 PM
PST Backup addin & Outlook 2003 K. Ramaswamy Microsoft Outlook Program Addins 0 13th Mar 2004 01:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:38 AM.