- ©«¤l
- 109
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 116
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2016-8-4
- ³Ì«áµn¿ý
- 2018-10-22
|
¦^´_ 6# msmplay
«á¨Ó·Q¤F¤@¤U¡A¦pªG¨S¦³¤@©wn¥ÎSaveCopyAsªºì¦]¡A¥Îl¤jªº¤è¦¡ª½±µSaveAs¤ñ¸û¦n¡C
¤£¹L³Ì¦nÁÙ¬O¥[Óif§PÂ_¡A¤£µM¦pªGÃö³¬ªº®ÉÔ¿ï§_¡A³Æ¥÷ÁÙ¬O·|°õ¦æ¡Aì¨Ó¥¿½Tªº³Æ¥÷´N³Q»\±¼¤F¡C
®³ºô¸ô¤W¸òl¤jªºcode²Õ¦X§ï¤F¤@¤U¡A±z¦A°Ñ¦Ò¬Ý¬Ý¡C- Private Sub Workbook_BeforeClose(Cancel As Boolean)
- Dim mypath As String, fname As String
- If Not Me.Saved Then
- Msg = "Do you want to save the changes you made to "
- Msg = Msg & Me.Name & "?"
- Ans = MsgBox(Msg, vbQuestion + vbYesNoCancel)
- Select Case Ans
- Case vbYes
- Me.Save
- Case vbNo
- Me.Saved = False
- Case vbCancel
- Cancel = True
- Exit Sub
- End Select
- End If
-
- If Me.Saved Then
- Application.DisplayAlerts = False 'Ãö³¬¨t²Îĵ§i°T®§
- fname = "¦Û°Ê³Æ¥÷" & Format(Date, "yymmdd") & ".xlsx"
- mypath = ThisWorkbook.Path & "\³Æ¥÷\"
- 'ThisWorkbook.Save 'nÀx¦s¦Û¨ÀɮסA½Ð¦Û¦æ¿ï¾Ün¤£nÀx¦s
- ThisWorkbook.SaveAs mypath & fname, FileFormat:=xlOpenXMLWorkbook
- Application.DisplayAlerts = True '¶}±Ò¨t²Îĵ§i°T®§
- Else
- Me.Saved = True
- End If
-
- End Sub
½Æ»s¥N½X |
|