Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VB6 Com Addin versus VBA Addin | Excel Programming | |||
setup project for Excel addin, won't register addin | Excel Programming | |||
Removing an Addin from the Tools Addin list. | Excel Programming | |||
Unshimmed Automation Addin and Shimmed COM Addin in same App Domai | Excel Programming | |||
Remove Excel AddIn from AddIn List !! Help | Excel Programming |