R
rskirsky
I found this old message (no replys) from 2001. I have the same
problem.
I did discover that if Excel is already open (for example, if another
workbook is
already open), then the perl script successfully creates the histogram.
If my script opens perl
itself, then the call to the histogram function does not work (no data
is created). I'm
not running a macro, but am calling the Data Analysis toolpack routine
directly.
I can work around this by using a batch program to open another dummy
Excel spreadsheet
before I call my perl script, but that is very clumsy. Has anyone
figured out what is going on here?
Oh, yeeh, I've manually aborted the script mid-stream and looked at
excel. It says the toolpak is
loaded and available.
Thanks,
Ray
****Message from Donald McGee in 2001 below*******
Has anyone had any success calling the Microsoft Excel Data Analysis
ToolPak Addin via Win32::Ole?
I'm trying to call an Excel macro via the ->Run method. Excel starts
properly, and the macro gets called and runs -- up to the point that
the
macro calls into the Data Analysis Toolpak routines. At that point,
the macro should create a histogram chart, but the chart doesn't get
created and subsequent attempts to access the non-extant chart object
of
course fail (with VBA error 1004).
The macro runs fine when called directly from within Excel. It only
fails when called from perl. I suspect the problem is related to
loading and intializing the addins.
Win32::Ole starts, stops, reads and writes Excel properly. I'm
manually
loading the atbvbaen, funcres and procdb xla modules. The data for the
chart is being provided via a Microsoft Access query, and is returned
properly when called via Win32::Ole.
problem.
I did discover that if Excel is already open (for example, if another
workbook is
already open), then the perl script successfully creates the histogram.
If my script opens perl
itself, then the call to the histogram function does not work (no data
is created). I'm
not running a macro, but am calling the Data Analysis toolpack routine
directly.
I can work around this by using a batch program to open another dummy
Excel spreadsheet
before I call my perl script, but that is very clumsy. Has anyone
figured out what is going on here?
Oh, yeeh, I've manually aborted the script mid-stream and looked at
excel. It says the toolpak is
loaded and available.
Thanks,
Ray
****Message from Donald McGee in 2001 below*******
Has anyone had any success calling the Microsoft Excel Data Analysis
ToolPak Addin via Win32::Ole?
I'm trying to call an Excel macro via the ->Run method. Excel starts
properly, and the macro gets called and runs -- up to the point that
the
macro calls into the Data Analysis Toolpak routines. At that point,
the macro should create a histogram chart, but the chart doesn't get
created and subsequent attempts to access the non-extant chart object
of
course fail (with VBA error 1004).
The macro runs fine when called directly from within Excel. It only
fails when called from perl. I suspect the problem is related to
loading and intializing the addins.
Win32::Ole starts, stops, reads and writes Excel properly. I'm
manually
loading the atbvbaen, funcres and procdb xla modules. The data for the
chart is being provided via a Microsoft Access query, and is returned
properly when called via Win32::Ole.