VBA判断是否连接公司内网/是否联网(Excel)

Function 测网(url) On Error Resume Next cmdping = "ping " & url & " -n 1" Set oExec = CreateObject("Wscript.shell").exec(cmdping) Do Until oExec.stdout.AtEndOfStream strline = strline & oExec.stdout.readline() & Chr(13) Loop 测网 = 0 If InStr(strline, "回复") Then 测网 = 1 Set oExec = Nothing End Function

Function 联网提示(url) If 测网(url) = 0 Then tip = Time & " 请确认是否连接上公司内网。" Debug.Print tip MsgBox tip End End If End Function

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏数据结构与算法

HDU 5536 Chip Factory

Problem Description John is a manager of a CPU chip factory, the factory produc...

34115
来自专栏机器学习入门

LWC 55:714. Best Time to Buy and Sell Stock with Transaction Fee

LWC 55:714. Best Time to Buy and Sell Stock with Transaction Fee 传送门:714. Best T...

1828
来自专栏开发 & 算法杂谈

PAT Advanced 1042

Shuffling is a procedure used to randomize a deck of playing cards. Because sta...

611
来自专栏ml

HDUOJ----Good Numbers

Good Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768...

2926
来自专栏张善友的专栏

VS.Net 2005 Design-Time Integration

Introduction This article provides an overview of the VS.NET 2005 Design-Time I...

1828
来自专栏小樱的经验随笔

HDU 1312 Red and Black(DFS,板子题,详解,零基础教你代码实现DFS)

Red and Black Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3276...

3448
来自专栏HansBug's Lab

1692: [Usaco2007 Dec]队列变换(BZOJ1640强化版)

1692: [Usaco2007 Dec]队列变换 Time Limit: 5 Sec  Memory Limit: 64 MB Submit: 682  So...

2645
来自专栏IT开发技术与工作效率

VBA破解VBA密码

1145
来自专栏ml

HDUOJ-------(1022)Train Problem I

Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32...

2727
来自专栏包子铺里聊IT

How to design and implement a deep iterator?

包子IT面试培训 助你拿到理想的offer! Question: Write a deep iterator to iterate through a li...

3135

扫码关注云+社区