目前我的代码导致excel崩溃。
Sub headerDate()
Dim iReply As String
iReply = Application.InputBox("What is the input? ")
With ActiveSheet.pageSetup
.CenterHeader = ""
.RightHeader = _
" Doc. No.: " & str(iReply) & Chr(10) & "Version: 2.3 (Modification f)" & Chr(10) & "Valid as of: 12/31/2012 "
End With
Application.PrintCommunication = True
Range("BI2").Select
End Sub
答案 0 :(得分:1)
我认为您需要将Str更改为Cstr:
"Doc. No.: " & CStr(iReply) & Chr(10) & "Version: 2.3 (Modification f)" & Chr(10) ...