참조 번호를 생성하는 폼으로 Excel에서 문제가 있습니다. 하지만 참조 번호를 생성하려고하면런타임 오류 '1004': 메서드 '개체'_Global '범위'실패했습니다.
이오류 '1004'런타임 : : 방법 '범위'object'_Global의 '
내가 디버그 버튼을 클릭
실패, 그것은 다음과 같이 코드를 보여줍니다 그것은라는 오류 메시지가 :그것은
가Sub clearTemplate()
' Clear Template Content
Range(inputTemplateHeader) = NO_ENTRY
Range(inputTemplateContent) = NO_ENTRY - (highlighted error)
End Sub
Sub clearRefNo()
' Clear cell G2 reference number
Range(cellRefNo) = NO_ENTRY
' Open "Report_ref_no.xls"
If Not (IsFileOpen) Then Workbooks.Open filename:=ThisWorkbook.Path & "\" & FACCESS
' Activate "Report_ref_no.xls"
Windows(FACCESS).Activate
' Access column D
Range(cellFirstRefNo).Select
Selection.End(xlDown).Select
If refNo = Cells(ActiveCell.Row, ActiveCell.Column - 1).Value Then
' Log Development Code column
Cells(ActiveCell.Row, ActiveCell.Column) = NO_ENTRY
' Log Issuer column
Cells(ActiveCell.Row, ActiveCell.Column + 1).Value = NO_ENTRY
' Log Date column
Cells(ActiveCell.Row, ActiveCell.Column + 2).Value = NO_ENTRY
End If
' Save & Close workbook
ActiveWindow.Close True
End Sub
사람이이 문제를 좀 도와 줄래 코드의 4 번째 줄에 오류를 강조? 나는 잘못 된 것이 무엇인지 모르겠다.
오류가 발생하면'inputTemplateContent' 및'NO_ENTRY'의 값은 무엇입니까? 그것은'Set Range (inputTemplateContent) = NO_ENTRY'에서 작동합니까? – assylias
혹시 같은 문제가 생길 경우를 대비하여 책과 시트를 지정하는 Range를 사용하고이 오류로 끝나면 책 이름에 공백이 없습니다 (어쩌면 당연한 것 일지 모르지만 레거시 매크로가 있고 VBA를 사용한 적이없는 경우). Excel의 경우 이는 까다로울 수 있음). – EAmez