Hi, Streen
I think this is what you mean: can I add a VB Macro into a Workbook using Perl... the answer is yes...
I have not coded it in Perl but you can do it in VBA so it should work.
Sub Test_VBComponent_Collection() Dim B As Workbook Set B = ThisWorkbook 'Iterate over the VBProjects available in the VBA (VB editor) 'There is probable only one! VBProjects(0) For Each proj In B.Application.VBE.VBProjects MsgBox proj.Name MsgBox proj.VBComponents.Count For Each comp In proj.vbcomponents 'Check Properties etc comp.Add (vbext_ct_ClassModule) Next Next End Sub
The VBComponent Object is documented in the help for Excel VBA (although you have to get there via VBAProject/See Also). It has some properties you'll find useful including CodeModule which is very poorly documented but is probably the thing you want to stick the text in...
Update: http://www.google.com/microsoft?q=CodeModule+Excel+VBA has some good links...
In reply to Re: Question about Win32::OLE and Excel
by maa
in thread Question about Win32::OLE and Excel
by Streen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |