如何删除Excel数据连接? [英] How to delete Excel data connection?

查看:673
本文介绍了如何删除Excel数据连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现VBA中的 $ workbook.Connections.Item(1).Delete 会从Excel工作表中删除数据连接。

I found out that $workbook.Connections.Item(1).Delete in VBA deletes the data connection from an Excel sheet.

在PowerShell中,这对我来说不起作用。 $ workbook.Connections.Count()在PowerShell中运行并返回一些连接。

In PowerShell this is not working for me. $workbook.Connections.Count() works and returns a number of connections in PowerShell.

任何想法如何可以使用PowerShell删除这些数据连接?

Any idea how I can delete these data connection with PowerShell?

推荐答案

更正此$ workbook.Connections.Item(1)。删除此 $ workbook.Connections.Item(1).Delete()

Correct this $workbook.Connections.Item(1).Delete to this $workbook.Connections.Item(1).Delete()

这篇关于如何删除Excel数据连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆