Excel VBA获取网页内容

 时间:2026-02-15 15:40:14

1、Function getWebString(sUrl As String)Dim HttpReq As ObjectSet HttpReq = CreateObject("MSXML2.ServerXMLHTTP")HttpReq.Open "GET", sUrl, FalseHttpReq.sendgetWebString = HttpReq.responseTextEnd Function

2、可以在表格里面以公式的形式来使用,如

=getWebString("https://www.baidu.com/s?wd=cc")

就可以得到指定页面的源码数据了

  • VBA代码-Excel 选中单元格区域并复制
  • Excel怎么自动加载宏,Excel宏怎么自动运行
  • Excel VBA代码执行的几种常用方式
  • Excel中如何设置简码输入
  • excel中vba函数inputbox的使用方法详解
  • 热门搜索
    丝瓜怎么做好吃 廿怎么读 红烧肉怎么做好吃 男人为什么会肾虚 牙龈萎缩怎么办 无花果怎么吃 剪映怎么去水印 腰肌劳损怎么恢复 电脑蓝屏了怎么办修复 为什么暑假比寒假长