Home: Perl Programming Help: Win32 Programming Help:
Win32::OLE macro code in sheet



mpij
New User

Aug 2, 2012, 4:32 AM


Views: 39373
Win32::OLE macro code in sheet

Hi,

I've problem with enter macro code into sheet1 in excel

Is there a way to add the macro to Sheet1 (because my exception
sub-routine works only from sheet1 and not from module).

Could u help me ?



mp


mpij
New User

Aug 3, 2012, 2:42 AM


Views: 39345
Re: [mpij] Win32::OLE macro code in sheet

The problem is here :



my $mod = $book->VBProject->VBComponents->Add(1)->CodeModule;

What should i write instead od CodeModule ?


mpij
New User

Aug 4, 2012, 2:54 AM


Views: 39303
Re: [mpij] Win32::OLE macro code in sheet

Problem has solved.

for someone who has the same:

my $mod = $book->VBProject->VBComponents->Item(Sheet1)->CodeModule;



Michal