Good book with a chapter on the subject: Beginning Access 2000 VBA by David Sussman and Robert Smith. WROX press. Their method is more straight forward than the one you are using and it works well
...Terry ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of jsivanan Sent: Tuesday, September 27, 2005 9:54 AM To: [email protected] Subject: [Access VBA Central] Creating Excel Charts from Access- Excel Anomaly This one might take someone with Excel macro and chart parameter savvy. I successfully (in Access Basic) exported a query to Excel, opened the spreadsheet application, turned on autofilter, highlighted the 1st 4 columns, chose a chart type (Line - Column on 2 Axes) and created a chart by 1st manually turning on a macro, doing what I wanted, turning off the macro then copying the code into an access module. Worked great. THEN in the same piece of code, I repeated the process with a similar query, same spreadsheet, same chart, i.e a 2nd chart in the same spreadsheet. The 1st chart was perfect, i.e 3 items in the legend on the side based on the 2nd, 3rd and 4th highlighted columns. For some reason the second chart had 4 items in the legend, 1 for each of the columns highlighted. Even weirder, if I ran my process a 2nd time, creating a 2nd spreadsheet in the same session, the 2nd chart was correct! To reiterate, if I close down access, restart access and try again, the 1st sheet has the problem with the 2nd chart and if I run the process again (from a form) the 2nd spreadsheet is fine, i.e. both charts are correct. Conclusion: Something gets initialized after the first spreadsheet has been created, but I have no idea what it is. More information: If I create a 3rd chart in the same spreadsheet (same process), both the 2nd and 3rd charts have the additional item in the legend. The second run corrects both the charts. Thanks for your patience. Any ideas on how to force Excel VBA to be consistent in it's using only 3 of the columns to graph? There must be an intermittent default. Perhaps if I had a full list of the chart variables settable by code I could ferret it out. Any ideas? Jnana Sivananda SPONSORED LINKS Microsoft access database <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+database&w1=Micros oft+access+database&w2=Microsoft+access&w3=Microsoft+access+database+des ign&w4=Microsoft+access+database+training&c=4&s=131&.sig=_NMBmgHqxR8S8tj yGl-Tnw> Microsoft access <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access&w1=Microsoft+acces s+database&w2=Microsoft+access&w3=Microsoft+access+database+design&w4=Mi crosoft+access+database+training&c=4&s=131&.sig=-5Xf2KTU4AmC58h30Cq3wg> Microsoft access database design <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+database+design&w1 =Microsoft+access+database&w2=Microsoft+access&w3=Microsoft+access+datab ase+design&w4=Microsoft+access+database+training&c=4&s=131&.sig=rEvcpxWQ YfjON1btwfI3Aw> Microsoft access database training <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+database+training& w1=Microsoft+access+database&w2=Microsoft+access&w3=Microsoft+access+dat abase+design&w4=Microsoft+access+database+training&c=4&s=131&.sig=pILo23 -rKYDuxPwf_IbrRQ> ________________________________ YAHOO! GROUPS LINKS * Visit your group "AccessVBACentral <http://groups.yahoo.com/group/AccessVBACentral> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessVBACentral/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
