简体   繁体   English

运行时错误'1004':对象'_Global'的方法'Range':选择打印形式

[英]run-time error '1004': Method 'Range' of object'_Global': Selecting forms for printing

I keep getting the message 我不断收到消息

Run-time error '1004': Method 'Range' of object'_Global failed 运行时错误'1004':对象'_Global的方法'Range'失败

I'm trying to be able to have only the forms print that have been selected by check boxes. 我正在尝试只打印已被复选框选中的表格。 Here is the code I have to print only the forms that checkboxes have been selected: 这是我必须仅打印已选中复选框的代码的代码:

Sub PrintForms()

   If Range("PrintClientInfo").Value = True Then
       Call PrintClientInfo
   End If

   If Range("PrintInitialCheque").Value = True Then
      Call PrintInitialCheque
   End If

   If Range("Print3102Form_Page_1").Value = True Then
      Call Print3102(1)
   End If

   If Range("Print3102Form_Page_2").Value = True Then
      Call Print3102(2)
   End If

   If Range("Print3102Form_Page_3").Value = True Then
      Call Print3102(3)
   End If

   If Range("Print3102Form_Page_4").Value = True Then
      Call Print3102(4)
   End If

   If Range("Print3102_localprintout").Value = True Then
      Call Print3102Form_Localprintout
   End If

   If Range("PrintDeclaration").Value = True Then
      Call PrintDelcaration
   End If

End Sub

All the others work, but the error seems to be with: 其他所有方法都起作用,但错误似乎出在:

If Range("Print3102_localprintout").Value = True Then

I have named ranges for all of them. 我为所有这些都命名了范围。 Can anyone help? 有人可以帮忙吗?

I just can guess since I don't know your named ranges, nor your functions. 我只能猜测,因为我不知道您的命名范围,也不知道您的功能。

Your pattern seems to be to name the ranges like your functions/subs. 您的模式似乎是要像函数/子目录那样命名范围。 Did you check if the range Print3102_localprintout really exists? 您是否检查范围Print3102_localprintout确实存在? Could it be Print3102Form_Localprintout ? 可以是Print3102Form_Localprintout吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行时错误'1004':对象'_Global'的方法'Range'失败 - Run-time error '1004' : Method 'Range' of object'_Global' failed 运行时错误'1004':对象'_Global'的方法'Range'失败 - Run-time error '1004': Method 'Range' of object '_Global' failed 运行时错误'1004'对象'_Global'的方法'Range'失败 - Run-time error '1004' Method 'Range' of object'_Global' failed 运行时错误'1004':对象'_Global'的方法'Range'失败6 - Run-time error '1004' : Method 'Range' of object'_Global' failed 6 运行时错误'1004' - 对象'_Global'的方法'范围'失败 - Run-time error '1004' - Method 'Range' of object'_Global' failed 运行时错误1004-对象'_Global'的方法'Range'失败 - Run-time error 1004 - Method 'Range' of object'_Global' failed 选择范围时出现运行时错误'1004' - run-time error '1004' on range selecting 运行时错误'1004'-VBA中对象'_Global'的方法'Range'失败 - Run-time error '1004' - Method 'Range' of object'_Global' failed in VBA VBA-运行时错误'1004'-对象'_Global'的方法'Range'失败 - VBA - Run-time error '1004' - Method 'Range' of object'_Global' failed 运行时错误'1004'-删除行时对象'_Global'的方法'Range'失败 - Run-time error '1004' - Method 'Range' of object'_Global' failed while deleting rows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM