Excel试用期VB代码编辑需要帮助 [英] Excel Trial Period VB Code Editng Need Help
本文介绍了Excel试用期VB代码编辑需要帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须在下面的这段代码中进行编辑,然后试用期到期我的工作簿非常隐密...
我需要设置非常隐藏的Cammad Also Repley
i Have To editing in this code below For Then The Trial Period Expired My Workbook gos Very Hidden ...
I need to set very hidden Cammad Also Repley
Option Explicit
Private Sub Workbook_Open()
Dim StartTime#, CurrentTime#
''*****************************************
''SET YOUR OWN TRIAL PERIOD BELOW
''Integers (1, 2, 3,...etc) = number of days use
''1/24 = 1Hr, 1/48 = 30Mins, 1/144 = 10Mins use
Const TrialPeriod# = 0 ''< 10000 day trial
''set your own obscure path and file-name
Const ObscurePath$ = "C:\"
Const ObscureFile$ = "aamir.Log"
''*****************************************
If Dir(ObscurePath & ObscureFile) = Empty Then
StartTime = Format(Now, "#0.#########0")
Open ObscurePath & ObscureFile For Output As #1
Print #1, StartTime
Else
Open ObscurePath & ObscureFile For Input As #1
Input #1, StartTime
CurrentTime = Format(Now, "#0.#########0")
If CurrentTime < StartTime + TrialPeriod Then
Close #1
Exit Sub
Else
If [A1] <> "Expired" Then
MsgBox "Sorry, your trial period has expired - your data" & vbLf & _
" www.xxxxxxx.com for your..." & vbLf & _
"" & vbLf & _
"This workbook will then be made unusable."
Close #1
SaveShtsAsBook
[A1] = "Expired"
ActiveWorkbook.Save
Application.Quit
ElseIf [A1] = "Expired" Then
Worksheets("Sheet1").Visible = xlSheetVeryHidden
Close #1
Application.Quit
End If
End If
End If
Close #1
End Sub
Sub SaveShtsAsBook()
Dim Sheet As Worksheet, SheetName$, MyFilePath$, N&
MyFilePath$ = ActiveWorkbook.Path & "\" & _
Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4)
With Application
.ScreenUpdating = False
.DisplayAlerts = False
On Error Resume Next ''<< a folder exists
MkDir MyFilePath ''<< create a folder
.Close SaveChanges:=True
End With
Open MyFilePath & "\READ ME.log" For Output As #1
Print #1, "Thank you for trying out this product."
Print #1, "If it meets your requirements, visit"
Print #1, "http://www.xxxxxxxxx.net.tc to Resloved"
Print #1, "the full (unrestricted) version..."
Close #1
End Sub
推荐答案
=" C:\ 常量ObscureFile
= "C:\" Const ObscureFile
="aamir.Log" ''********************************************* 如果Dir(ObscurePath& ObscureFile)=空,则 StartTime =格式(现在为#0.######### 0") 打开ObscurePath&输出为#1的ObscureFile 打印#1,开始时间 别的 打开ObscurePath&输入为#1的ObscureFile 输入#1,开始时间 CurrentTime = Format(现在为#0.######### 0") 如果CurrentTime< StartTime + TrialPeriod然后 关闭#1 退出子 别的 如果[A1]<>然后过期" MsgBox对不起,您的试用期已到期-您的数据"& vbLf& _ "www.xxxxxxx.com为您..."& vbLf& _ "和vbLf& _ 此工作簿将因此变得不可用." 关闭#1 SaveShtsAsBook [A1] =已过期" ActiveWorkbook.Save 申请退出 ElseIf [A1] =已过期"则 Worksheets("Sheet1").Visible = xlSheetVeryHidden 关闭#1 申请退出 万一 万一 万一 关闭#1 结束子 子SaveShtsAsBook() Dim Sheet As Worksheet,SheetName
= "aamir.Log" ''***************************************** If Dir(ObscurePath & ObscureFile) = Empty Then StartTime = Format(Now, "#0.#########0") Open ObscurePath & ObscureFile For Output As #1 Print #1, StartTime Else Open ObscurePath & ObscureFile For Input As #1 Input #1, StartTime CurrentTime = Format(Now, "#0.#########0") If CurrentTime < StartTime + TrialPeriod Then Close #1 Exit Sub Else If [A1] <> "Expired" Then MsgBox "Sorry, your trial period has expired - your data" & vbLf & _ " www.xxxxxxx.com for your..." & vbLf & _ "" & vbLf & _ "This workbook will then be made unusable." Close #1 SaveShtsAsBook [A1] = "Expired" ActiveWorkbook.Save Application.Quit ElseIf [A1] = "Expired" Then Worksheets("Sheet1").Visible = xlSheetVeryHidden Close #1 Application.Quit End If End If End If Close #1 End Sub Sub SaveShtsAsBook() Dim Sheet As Worksheet, SheetName
,MyFilePath
, MyFilePath
这篇关于Excel试用期VB代码编辑需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文