Resources problem with VBA & charts

C

Charley Kyd

I've written a short UDF with this line:

gUnit =
ThisWorkbook.Worksheets(sReportSheet).ChartObjects(sChartName).Chart.Axes(xlValue).MajorUnit

When I call the function from a small (27 kb) workbook I get this message:
"Excel cannot complete this task with available resources. Choose less data
or close other applications."

But when I replace that line with...

gUnit = .05

....I don't get the message. And with regard to resources, these problems
come after a reboot with only Excel open.

Additionally, when that line is included, I'm getting very frequent crashes.

Does anyone have any ideas about ways to get around these problems?

Thanks.

Charley
 
J

Jon Peltier

Charley -

This kind of thing is frustrating. Any other charts on the worksheet or
in the workbook? Can't be many if it's only 27 kb. Can't be much other
code, either. Is the UDF in a regular module?

The one thing I'm thinking of is that it might be a corrupted worksheet
or workbook (I had one the other day). See if rebuilding the sheet from
a new blank sheet helps.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top