Hi,
I want to "copy" a a few cells onto another range and let Excel decide how to do that (i.e. Autofill with xlFillDefault). It is not working in perl. Here's the macro which I've recorded in Excel:
Range("A2:B2").Select Selection.AutoFill Destination:=Range("A2:B17"), Type:=xlFillDefault
And my perl code: (I've copied the relevant syntax from http://code.mincus.com/42/perl-win32ole-excel-selection-texttocolumns/ and think it should be working)
my $excel = Win32::OLE::Strict->new('Excel.Application', 'Quit'); my $workbook = $excel -> Workbooks -> Open("$templfile"); my $sh = $wb -> Worksheets(1) -> {Name}; $sh -> Activate; my $srcrange = 'A2:B2'; my $targrange = 'Range("A2:B17")'; $sh -> Range("$srcrange ") -> Select; my $xlfill = 'xlFillDefault'; $excel -> Selection -> AutoFill({Destination => $targrange, Type => $x +lfill});
What happens is that the "from-range" (A2:B2) gets selected. The AutoFill seems to be ignored (no error message, no action). Any ideas?
Thanks,
Dave
In reply to Win32::OLE Excel AutoFill not working by DaveTheMan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |