Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Using Win32::OLE and Excel - Tips and Tricks

by ArmandoG (Sexton)
on Jan 25, 2008 at 00:56 UTC ( #664186=note: print w/replies, xml ) Need Help??

in reply to Using Win32::OLE and Excel - Tips and Tricks

this tutorial has being my foundation on the project at work thank you, since that said, I am a newbie in Win32::OLE I got this problem I need to copy a cell and cant do it this is the code I am using:
$Sheet->Range('A17')->Select(); $Sheet->Selection->Copy('A17'); $Sheet->Range('B15')->Select(); $Sheet->ActiveSheet->Paste();
but that did not work what is wrong? I take this from the VBA in the macro.
Oh. yes I am using only WIN32::OLE

Replies are listed 'Best First'.
Re^2: Using Win32::OLE and Excel - Tips and Tricks
by Anonymous Monk on Jan 28, 2008 at 06:13 UTC
    Try if it works:





Re^2: Using Win32::OLE and Excel - Tips and Tricks
by HelenCr (Monk) on Dec 11, 2012 at 19:22 UTC

    This piece of code doesn't work because "Selection" is a method of the parent Excel application, not the sheet.

    So if you had, in the beginning of your code:

    my $XcelApp = Win32::OLE->new( 'Excel.Application' );

    Then the second line in your post should go:



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://664186]
[shmem]: grappa, ginebra o amaretto?
[shmem]: LanX: tried strange stuff wrt autocomplete. No luck :(
[erix]: sambuca
[LanX]: machiato!
shmem fills a glas with sambuca, drops 3 beans of coffee into it, lights the stuff and hands it to erix
[Your Mother]: Liquore Strega. :P
[shmem]: s/beans of coffee/enterprise beans/ :-P
[erix]: Take your bottles -- you're all invited! :)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2017-03-28 12:18 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (330 votes). Check out past polls.