我公司以前的一个同事写了个宏用来处理测试数据的,
在某些电脑上可以运行,但是在某些电脑上就不能运行了。 不知道是不是excel版本的问题,请大虾们帮着看看。 我在自己家的电脑上也无法运行。
Private Sub cmdAddFile_Click()
Dim no_of_file, row, column As Integer
no_of_file = 1
row = 8
column = 1
CommonDialog1.Filename = "" ----运行到这一句的时候就停了,提示:运行时错误‘424’,要求对象
CommonDialog1.Filter = "*.hst_a"
CommonDialog1.Action = 1 Do Until CommonDialog1.Filename = "" Or CommonDialog1.Filename = "*.hst_a" If CommonDialog1.Filename <> "" Or CommonDialog1.Filename = "*.hst_a" Then
Do Until ActiveSheet.Cells(row, column) = ""
row = row + 1
Loop
ActiveSheet.Cells(row, column) = ActiveSheet.Cells(row - 1, column) + 1
ActiveSheet.Cells(row, column + 1) = CommonDialog1.Filename
End If CommonDialog1.Filename = ""
CommonDialog1.Action = 1 Loop End Sub |