Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

activechart.location codes?

Status
Not open for further replies.

greggb

Programmer
Dec 6, 2003
30
US
I am using the following code to save an automatically generated pie chart in a general field in Excel:

.ActiveChart.Location(2,oSheet.Name)

I actually want to save it as an embedded object instead of a sheet. I have tried xlLocationAsObject instead of the "2" but it does not recognize this. Is there another numerical code for save as object. If so, how would you put the name in?

Thanks in Advance
 

You may want to get a list of all the Excel Constants to help you out. Take a look at faq184-4248. But to answer your question, there are three possible values for the parameter, they are:
Code:
#DEFINE xlLocationAsNewSheet	1	
#DEFINE xlLocationAsObject	2	
#DEFINE xlLocationAutomatic	3


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
greggb,

Further to Mike's reply, if you are planning to use these constants a lot, I would create a header file (for example common.h) with the 3 lines that Mike has given you and then, in your program, put the line
Code:
#INCLUDE <pathname>\common.h
That way you don't have to DEFINE these things in every program and method.


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top