我有一個簡短的 Excel VBA 宏,它在(打開的)CorelDraw 繪圖中獲取當前選擇并移動它。當我設定OrigSelection為 時,為什么會出現不匹配的運行時錯誤app.ActiveSelectionRange?這是我的代碼:
Private Sub MoveAndResizeSelection()
Dim app As CorelDraw.Application
Set app = CorelDraw.Application
Dim OrigSelection As ShapeRange
Set OrigSelection = app.ActiveSelectionRange
'Move and Resize the selection
OrigSelection.Move 2.595, -6.751
End Sub
我正在使用 Excel Office 16 和 CorelDraw Graphics Suite 2022。
uj5u.com熱心網友回復:
罪魁禍首是
Dim OrigSelection As ShapeRange
這是隱含的
Dim OrigSelection As Excel.ShapeRange
改成
Dim OrigSelection As CorelDraw.ShapeRange
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/484812.html
