自动开启网页 程序 文件 档案

Private Sub CommandButton2_Click()'开启网页
    Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE www.runoob.com/python/python-intro.html", vbNormalFocus
End Sub


Private Sub CommandButton2_Click()'调用外部程序
     Shell "D:\Anaconda\python.exe D:\我的python\语音.py", vbNormalFocus
End Sub



Private Sub CommandButton3_Click()'调用Python发送邮件
Shell "python D:\我的python\新.py", vbNormalFocus
End Sub
Private Sub CommandButton3_Click()'开启程序微信
Shell "C:\Program Files (x86)\Tencent\WeChat\WeChat.exe", vbNormalFocus
End Sub
    With CreateObject("internetexplorer.application")
        .Visible = True
        .Navigate "https://www.baidu.com/s?wd=扯乎"
'关闭网页
'       .Quit
    End With
EXCEL表格函数打开应用程序
如果是在工作表里,我们可以使用该函数:
=HYPERLINK("C:\Windows\System32\calc.exe","打开计算器")



Dim Program As String
Dim TaskId As Double

Program = "calc.exe"   ' 计算器
On Error Resume Next   '遇到错误,继续执行下面语句
AppActivate "计算器"    ' 这里是应用程序面板的标题titile
If Err <> 0 Then   ' 如果没有捕捉到‘计算器’程序,则err不等于0
    Err = 0
    TaskId = shell(Program, 1)    ' 打开计算器
    If Err <> 0 Then MsgBox "无法打开计算器"
End If
Private Sub CommandButton9_Click()'开启文件夹
 Shell "explorer.exe D:\我的python", vbNormalFocus
End Sub

Private Sub CommandButton11_Click()

Workbooks.Open Filename:="C:\Users\Administrator\Desktop\证件登记.xlsm"

End Sub


import cv2#摄像头拍照片
cap = cv2.VideoCapture(0)
   # 获得图片
ret, frame = cap.read()
    # 展示图片
#cv2.imshow("captur", frame)
cv2.imwrite("captura.jpg", frame)
cap.release()
cv2.destroyAllWindows()

import cv2#人脸识别

cap = cv2.VideoCapture(0)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()

    # Our operations on the frame come here
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    xmlfile = r'D:\Anaconda\Lib\site-packages\cv2\data\haarcascade_frontalface_default.xml'

    face_cascade = cv2.CascadeClassifier(xmlfile)

    faces = face_cascade.detectMultiScale(
        gray,
        scaleFactor=1.15,
        minNeighbors=5,
        minSize=(5, 5),
    )
    print("发现{0}个目标!".format(len(faces)))
    for (x, y, w, h) in faces:
        cv2.rectangle(frame, (x, y), (x + w, y + w), (0, 255, 0), 2)

    cv2.imshow("frame", frame)
    # Display the resulting frame
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()


Sub 宏4()
'
' 宏4 宏
'

'
    ActiveWorkbook.Worksheets.Add
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;https://m.sz.pegatroncorp.com/ASSA/Modules/Login/Login.aspx", Destination:= _
        Range("$A$1"))
    
        .Name = "www.so.com"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 1
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub
import tkinter#时钟
import time

def gettime():
    timestr = time.strftime("%H:%M:%S")     # 获取当前时间并转换为字符串
    lb.configure(text = timestr)            # 重新设置标签文本
    root.after(1000, gettime)               # 每隔1S调用函数 gettime 自身获取时间

root = tkinter.Tk()
root.title('时钟')

lb = tkinter.Label(root, text = '', fg = 'blue', font = ("黑体", 80))
lb.pack()
gettime()
root.mainloop()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

贾激光

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值