in reply to HELP in VBA to WIN32::OLE
Where does the with keyword come from and what do you think it does?
If you want a really verbatim translation, you need to replace the With X from VB with for (X) { in Perl:
for ($app->Selection) { $_->{ColorIndex} = 8; };
I recommend that you instead move away from the (application) global variables like $app->Selection and instead use Perl variables:
my $sel = $app->Range("A1"); my $interior = $sel->Interior; $interior->{ColorIndex} = 8; $interior->{Pattern} = xlSolid;
If you want to translate from VB to Perl, you need to know about both languages. Wild throwing around of keywords and syntax won't get you far.
|
|---|