使用 JET 驱动程序表引用 Excel 工作表时使用下划线重复

发布于 2024-10-08 22:53:19 字数 328 浏览 3 评论 0原文

我正在使用 JET 数据库驱动程序引用一份 Excel 文档,该文档一直工作正常,直到有一天应用程序失败。经过进一步调查,我注意到选项卡在某些情况下是重复的(实际上是所有选项卡) - 即 Tab1$ 和 Tab1$_。我研究过这个问题,发现这是由用户应用过滤器引起的。现在过滤器已被删除,没有特殊格式、冻结窗格或打印格式,但我仍然复制了这些选项卡。通常我会围绕这个编写代码,但由于我们处于代码冻结状态,我需要提出一个基于 Excel 的解决方案。我想摆脱那些疯狂的下划线标签名称/崇敬。如有必要,我可能可以运行一个程序来清理文件,然后将其发送回用户,但我想首先探索 Excel 选项。想法?我有 Excel 2010,也可以访问任何其他版本。

I'm referencing an excel document with the JET database driver, which was working just fine until one day the application failed. Upon further investigation I noticed that the tabs were duplicated in some instances (all tabs actually) - i.e. Tab1$ and Tab1$_. I've researched this issue and found that it is caused by the user applying a filter. Now the filters have been removed, no special formatting, frozen panes, or print formats, but still I have these tabs duplicated. Normally I'd code around this, but since we're in a code freeze I need to come up with an Excel based solution. I want to get rid of those crazy underscored tab names / reverences. I could probably run a program to clean up the file if necessary, to send it back to the users, but I want to explore Excel options first. Thoughts? I have Excel 2010, and access to any other version as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

唠甜嗑 2024-10-15 22:53:19

下划线“sheet”是命名范围。你可以运行VBA吗?如果是这样:

Dim defName As Name
''Either
With ThisWorkbook ''Entire workbook
  For Each defName In .Names
    MsgBox defName.Name
    defName.Delete
  Next
End With
''Or
With Sheets("Sheet1") ''Scoped to sheet only
  For Each defName In .Names
    MsgBox defName.Name
    defName.Delete
  Next
End With

The underscore "sheet" is a named range. Is it possible for you to run VBA? if so:

Dim defName As Name
''Either
With ThisWorkbook ''Entire workbook
  For Each defName In .Names
    MsgBox defName.Name
    defName.Delete
  Next
End With
''Or
With Sheets("Sheet1") ''Scoped to sheet only
  For Each defName In .Names
    MsgBox defName.Name
    defName.Delete
  Next
End With
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文