设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 6940|回复: 8

[原创]设置Excel VBA程序使用期限

[复制链接]
发表于 2007-1-22 01:49:00 | 显示全部楼层 |阅读模式
1、用户窗体“确定”按钮代码


Private Sub CommandButton1_Click()


Dim rg As Range


Set rg = ws.[c9]


If Text1.Text = "123456" Then


MsgBox "欢迎进入VBA数据库开发课堂", vbOKOnly + vbInformation, "提示"


rg = "你对知识的渴望正是我们生生不息的源动力"


rg.Font.Color = RGB(255, 0, 0)


rg.Font.Name = "宋体"


rg.Font.Bold = True


rg.Font.Size = 12


Unload Me


Else


MsgBox "你输入的密码错误,请重新输入", vbOKOnly + vbInformation, "错误提示"


Text1.Text = ""


Text1.SetFocus '获得焦点


End If


End Sub


2、用户窗体“取消”按钮代码


Private Sub CommandButton2_Click()


Unload Me


ActiveWorkbook.Close (False) '不显示保存对话框


End Sub


3、模块使用期限(syqx)代码


Sub drrj()


'不让屏幕刷新


Application.ScreenUpdating = False


Dim i As Integer


Dim x As Integer


Dim n As Integer


drsj.Visible = xlSheetVisible


'统计当前数据区域的总行数


i = drsj.[a1].CurrentRegion.Rows.Count


'如果错误就跳过


On Error Resume Next


If drsj.[a1] = "" Then


drsj.[a1] = Now


drsj.Visible = xlSheetVeryHidden


Exit Sub


End If


drsj.Cells(i + 1, 1).Value = Now


x = drsj.Cells(i + 1, 1).Value - drsj.Cells(i, 1).Value


n = drsj.Cells(i + 1, 1).Value - drsj.Cells(1, 1).Value


drsj.Visible = xlSheetVeryHidden


If n > 60 Or x < -1 Then


MsgBox "你的试用期已过,请与管理员联系"


<FONT face="Times New Ro

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2007-4-6 05:53:00 | 显示全部楼层
试试
发表于 2007-5-9 22:03:00 | 显示全部楼层
能行吗?看不懂VBA语句啊,真汗![em04]
发表于 2007-5-23 17:57:00 | 显示全部楼层
好,支持
发表于 2009-3-3 16:33:02 | 显示全部楼层
顶顶顶顶顶
发表于 2009-4-10 09:06:03 | 显示全部楼层

点击这里给我发消息

发表于 2016-12-3 18:10:25 | 显示全部楼层
顶顶顶顶顶

点击这里给我发消息

发表于 2019-4-12 20:36:55 | 显示全部楼层
60天许可
?????
回复

使用道具 举报

点击这里给我发消息

发表于 2020-4-24 15:58:09 | 显示全部楼层
学习
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-4-19 07:00 , Processed in 0.117395 second(s), 34 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表