wps excel启用宏
下载wps.vba.exe 链接: /s/1kMvoVfzzi719oAcfmoNpGw 密码: qn86b站教程安装wps.vba.exe重启wps即可VB编辑器
弹出窗口新建模块
添加代码
Function getTitle(sUrl As String)Dim oXHTTP As Object, Str As StringSet oXHTTP = CreateObject("MSXML2.XMLHTTP")oXHTTP.Open "GET", sUrl, FalseoXHTTP.sendgetsource = StrConv(oXHTTP.responseBody, vbUnicode, &H804)Set oXHTTP = NothingArr = VBA.Split(getsource, "<title>")Str = Arr(1)Arr = VBA.Split(Str, "</title>")Str = Arr(0)getTitle = StrEnd Function
使用方法 :例如网址在A1单元格,公式写成:=getTitle(A1),最后保存文件的时候,保存成.xlsm文件即可
注意:宏执行过程中不要去动他了,容易卡死