473,513 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

If ActiveChart isn't active then

1 New Member
I wrote a macro in Excel. It's PivotTables pulling from an Access query and feeds 4 charts.

If I'm refreshing the data from the charts, my code works fine, but if do it from the PivotTable, I always get a "Run-time error 91: Object variable or With block variable not set".

What I need is an If...Then statement to check whether a chart is selected, if so run my code, if not return. What I've been trying is along these lines:

If ActiveChart.ChartArea.Select = False Then
Return
Else
Dim srs As Series
For Each srs In ActiveChart.SeriesCollection
srs.Fill.TwoColorGradient Style:=msoGradientHorizontal, Variant:=1
srs.Fill.BackColor.SchemeColor = 2
Select Case srs.Name
...
End Select
Next
End If
End Sub

Thanks in advance for any help.

Brian
Aug 7 '06 #1
1 1781
sashi
1,754 Recognized Expert Top Contributor
Hi Brian,

kindly refer to the link below.. it explains more about the runtime error 91.. take care my fren..

http://www.thescripts.com/forum/thread13693.html
Aug 9 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

25
3322
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard...
1
1924
by: arreeess | last post by:
#styleDiv a:hover {...} Topstyle message: - Pseudo-class :hover isn't supported by this style definition is or isn't an error? why this warning ? thank you
1
4732
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
1
3878
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
10
3994
by: Chris Wertman | last post by:
I am looking to capture the URL of the ACTIVE IE window. How the heck can I determine which window is the active window. Better yet how do I grab the URL of that particular window ? I am...
0
2727
by: jakobsgaard | last post by:
It is possible to Map a certificate to a Active Directory User Account from DotNet? Please provide an example. Best regards, Ejnar Jakobsgaard...
3
2879
by: M.L. Abram | last post by:
Hello all, I do not know if this question is regarding table design, queries, or programming. Below, I have given a table design using Access 2003. Fields 'Product' and 'Color' are primary keys...
8
8230
by: salad | last post by:
I was wondering how you handle active/inactive elements in a combo box. Let's say you have a combo box to select an employee. Joe Blow has been selected for many record however Joe has left the...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4751
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.