对象不接受方法

发布于 2024-10-23 13:50:45 字数 407 浏览 4 评论 0原文

我的 VBA 应用程序遇到问题。
我需要定义一个记录集并将特定字段的结果逐行输入到 Excel 工作表中。 问题是,当我这样做时,

With appXLS.Worksheets("Resultado Geral")
    For intPosition = LBound(Arr) To (UBound(Arr) - 1)
        teste = Arr(intPosition, 0) & "_Status"
        .Cells(i, 6) = MyRecBase.Fields(teste)
    Next
End With

它会显示问题(错误“438”)并标记“.Cells”行。但最大的问题是我之前几行使用了相同的方法。

请帮我。我将不胜感激。

提前致谢

I'm experiencing a problem with my VBA application.
I need to define a Recordset and enter the result of a certain field, line by line, into an Excel Worksheet.
The problem is, when I do this

With appXLS.Worksheets("Resultado Geral")
    For intPosition = LBound(Arr) To (UBound(Arr) - 1)
        teste = Arr(intPosition, 0) & "_Status"
        .Cells(i, 6) = MyRecBase.Fields(teste)
    Next
End With

It displays the problem (Error '438') and marks the ".Cells" line. But the biggest problem is that I use the same method a few lines before.

Please, help me. I would appreciate.

Thanks in advance

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

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

发布评论

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

评论(1

淡淡の花香 2024-10-30 13:50:45

检查代码中的行:

.Cells(i, 6) = MyRecBase.Fields(teste)

因为不清楚 i 是什么以及如何根据循环计算它。

Check the line in your code:

.Cells(i, 6) = MyRecBase.Fields(teste)

since it is not evident what i is and how it is calculated based on your loop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文