PC Review


Reply
Thread Tools Rate Thread

call VB code on refresh.

 
 
GS80
Guest
Posts: n/a
 
      18th Mar 2008
Hi,

I have an Excel file with several office data connections. I'm having
minimum difficulty with the data that comes in and is used in various charts.
What i am having trouble with is when i have to manipulate the data as it is
to be presented in a tabular format with formatting etc. I'm doing this
automatically from an application, however am setting up the basics in an
Excel file which will be used as a template.

The paticular table i'm trying to produce is almost there aside from a bar
chart which sits alongside the table and each bar is specific to the row it
sits next to. What i need to do is once the data is refreshed i want to
resize my chart object so that it is the same height as the number of rows
in its data range. I figure i can do this is VBA behind the scenes but i need
to know is what event I can add the code to and where this goes in the VBA
project behind the scenes.

Is it also possible that everytime the file is opened that i don't get a
warning regarding diabled macros.

Thanks in advance,

G
 
Reply With Quote
 
 
 
 
Dick Kusleika
Guest
Posts: n/a
 
      18th Mar 2008
On Tue, 18 Mar 2008 08:41:02 -0700, GS80 <(E-Mail Removed)>
wrote:

>I have an Excel file with several office data connections. I'm having
>minimum difficulty with the data that comes in and is used in various charts.
>What i am having trouble with is when i have to manipulate the data as it is
>to be presented in a tabular format with formatting etc. I'm doing this
>automatically from an application, however am setting up the basics in an
>Excel file which will be used as a template.
>
>The paticular table i'm trying to produce is almost there aside from a bar
>chart which sits alongside the table and each bar is specific to the row it
>sits next to. What i need to do is once the data is refreshed i want to
>resize my chart object so that it is the same height as the number of rows
>in its data range. I figure i can do this is VBA behind the scenes but i need
>to know is what event I can add the code to and where this goes in the VBA
>project behind the scenes.
>
>Is it also possible that everytime the file is opened that i don't get a
>warning regarding diabled macros.


What are office data connections? External data tables? If so, the
Calculate event will probably work. You'll find that in the Sheet's class
module. Pull down Worksheet on the left dropdown and Calculate on the right
dropdown.

Also, you can access the AfterRefresh event of the QueryTable object if you
set up a custom class. Let me know if you want to go that route.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to Refresh inbound data sheets, then Refresh Pivot Tables AFSSkier Microsoft Excel Programming 3 4th Sep 2009 07:59 PM
Call code to make phone call Mary Windows XP General 1 8th Nov 2004 08:18 PM
disable call waiting on a local call puts in area code JMB Windows XP General 0 17th Feb 2004 10:32 PM
disable call waiting on a local call puts in area code JMB Windows XP Print / Fax 0 17th Feb 2004 10:32 PM
disable call waiting on a local call puts in area code JMB Windows XP Print / Fax 0 16th Feb 2004 11:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:11 PM.