问题描述
我正在尝试通过写入的路径和xls文件打开文件。
I am trying to open a file via path that is written in and xls file.
路径在单元格是:
the path in the cell is :
用户:vereddavidman:文件:工作计划:VBA1:T3.CSV
Users:vereddavidman:Documents:work Plans:VBA1:T3.CSV
当我运行脚本时,我收到一个"对象必需"的错误。
when i run the script i receive an error that "Object required".
我不确定问题出在哪里以及我是否正确编写了Path并且我在Mac中编写它。
I am not sure where the issue is and if i wrote the Path correctly and i am writing it in Mac.
谢谢你的帮助。
推荐答案
Set Pathname = ActiveWorkbook.ActiveSheet.Cells(4, b).Value
变量'b'的值是多少?
What is the value of the variable 'b' ?
单元格的语法是:单元格(行数,列数)
The syntax for Cells is: Cells(number of line, number of column)
如果你想获得范围B4的值,你应该使用'cells(4,2).value'
If you want to get the value of range B4, you should use 'cells(4, 2).value'
这篇关于输入变量的路径以便在VBA代码xls for Mac中打开文件时输入变量的路径时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!