0
大家好接收範圍類的「1004」複製方法試圖使用複印功能和發送到另一個設定範圍時失敗。任何想法,爲什麼這可能會發生?下面的代碼(注:我沒有得到關閉循環尚未我是建設的成立,跑進這個錯誤我沒有刪除的循環,因爲我只是在調試這個問題。):1004 Error對象
Sub GetOiData(cmeDataBook As Workbook, oiSheet As Worksheet)
'Loops through OI data sheets and transfers OI data by puts and calls cleanly
Dim dataSheet As Worksheet
Dim startMonthLocation As Range, startRangePutStrike As Range, startRangeCallStrike As Range, monthFutureVolumeFinder As Range
Dim monthConverted As String, callOpt As String, putOpt As String, assetType As String
Dim continue As Boolean
callOpt = " Calls"
putOpt = " Puts"
assetType = oiSheet.Cells(1, 1).Value
continue = True
Set dataSheet = cmeDataBook.Sheets(GetDataSheetDesignation(assetType))
Set startMonthLocation = oiSheet.Cells(2, 2)
dataSheet.Activate
'Iterates through entire Oi data sheet incrementally
Do While continue = True
'Finds total volume for the month and then sets monthConverted to prepare for oi process
monthConverted = MonthCode(oiSheet.Cells(2, 2).Value)
Set monthFutureVolumeFinder = dataSheet.Columns(1).Find(Trim(monthConverted))
monthFutureVolumeFinder.Offset(0, 4).Copy (startMonthLocation.Offset(1, 0))
Loop
End Sub