如何将以下excel vba语句转换为perl win32 :: ole语句?
Range(Selection, Selection.End(xlDown)).Select
我转换如下,但不起作用:
my $Excel = CreateObject OLE "Excel.Application";
my $SecondSht = $Book->ActiveSheet;
$SecondSht->Range("P2")->Select();
$SecondSht->Range({$Excel->Selection(), {$Excel->Selection()->End({xlDown})})->Select(); #fails at this statement
$Excel->Selection->Copy;
$SecondSht->Range({"Q2"})->Select;
$SecondSht->Paste;
答案 0 :(得分:1)
我得到了答案!
$SecondSht->Range($SecondSht->Range("P2"), $SecondSht->Range("P2")->End(xlDown))->Select();
$Excel->Selection->Copy;
$SecondSht->Range("Q2")->Select();
$SecondSht->Paste;