A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem changing chartype using Chartwizard in VB Express



 
 
Thread Tools Display Modes
  #1  
Old December 2nd, 2008, 12:30 PM posted to microsoft.public.excel.charting
Kenny Thompson
external usenet poster
 
Posts: 1
Default Problem changing chartype using Chartwizard in VB Express

Hi,

I am trying to create a line graph using a Microsoft VB Express module.

I can get the grpah to appear with labels etc however I cannot change the
chart type to line(or any other type).
Below is the segment of code I have to display the graph:

With oBook.ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=375, Top:=75, Height:=225)
.Chart.ChartWizard(Source:=oBook.ActiveSheet.Range ("C4:C10"),
Gallery:=xlLine, Title:="TEST", _
ValueTitle:="# of trans", CategoryTitle:="tps")
End With


The error I get is " Name 'xlLine' is not declared.

What I dont understand is that the Title,ValueTitle,CategoryTitle properties
all work fine but I get the error on the Gallery property.

Any suggestions appreciated.
--
KT
  #2  
Old December 2nd, 2008, 05:40 PM posted to microsoft.public.excel.charting
Jon Peltier
external usenet poster
 
Posts: 5,018
Default Problem changing chartype using Chartwizard in VB Express

What's VB Express? Is that the lightweight dot-net thingy Microsoft released
a couple years ago?

xlLine is a built-in Excel VBA constant. If you have set a reference to
Excel's object library, this would probably not be an issue. Whatever. Go to
Excel's VB Editor. Press Ctrl+G to open the Immediate Window. In the
Immediate Window, type

?xlLine

and press Enter. VBA responds with 4. Replace the xlLine constant with the
value 4, and your code should run.

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



"Kenny Thompson" wrote in message
news
Hi,

I am trying to create a line graph using a Microsoft VB Express module.

I can get the grpah to appear with labels etc however I cannot change the
chart type to line(or any other type).
Below is the segment of code I have to display the graph:

With oBook.ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=375, Top:=75, Height:=225)
.Chart.ChartWizard(Source:=oBook.ActiveSheet.Range ("C4:C10"),
Gallery:=xlLine, Title:="TEST", _
ValueTitle:="# of trans",
CategoryTitle:="tps")
End With


The error I get is " Name 'xlLine' is not declared.

What I dont understand is that the Title,ValueTitle,CategoryTitle
properties
all work fine but I get the error on the Gallery property.

Any suggestions appreciated.
--
KT



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:32 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.