我有以下有效的代码,但抛出了
"Run-time '1004' Unable to set the Printout property of the worksheet class"
这是代码:
Sub PrintOutv1()
'PrintOutv1 Macro
Dim Val As Double
Val = ActiveWorkbook.Sheets("WU").Range("E1").Value
ActiveWorkbook.Sheets("WU").PrintOut(1, Val, 1, True) = True
答案 0 :(得分:0)
肢体再次叮咬!在参数周围加上括号,不要尝试赋值:
Dim myVal As Double '<~ avoid confusion with the Val function
myVal = ActiveWorkbook.Sheets("WU").Range("E1").Value
ActiveWorkbook.Sheets("WU").PrintOut 1, myVal, 1, True