Problem Creating Excel Chart TextBoxes in Access 2010

JonMulder

Registered User.
Local time
Today, 09:19
Joined
Apr 9, 2011
Messages
23
Greetings,

I made up an Excel VBA module to automatically create fairly complex charts with several textboxes. I've since learned that I can invoke Excel inside Access and create the charts. This is going VERY well, and the charts look great. However, when I want to start adding some textboxes, I get an error message "Variable not defined". For some reason, it doesn't like "msoTextOrientationHorizontal". I have the Microsoft Excel 14.0 Object Library referenced.

Below is a distillation of my code:

Dim x1 As Excel.Application
Set x1 = New Excel.Application
'Lots of code here creating the chart object.
x1.ActiveChart.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 200, 50).Select
x1.Selection.Characters.Text = "State Well" & vbNewLine & "Number"

Any ideas? Thanks in advance for what light folks can shed on this!

Jonathan Mulder
Engineering Geologist
California Department of Water Resources
 

Users who are viewing this thread

Back
Top Bottom