Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Linking Office Chart 10.0 In A Form To An Excel Worksheet


I`m trying to create a chart on a form in excel that can be updated in real time (or at least at the click of a button) based on changes to parameters made in the form. I have inserted a microsoft chart 10.0 object and can make the chart just find using the chart wizard and copying and pasting the relevant cell ranges from my worksheet. However this does not obviously allow real time changes to occur. In all the help I have found on this topic, the code i seem to require is to set ChartSpace1.datasource = spreadsheet1, and then allocate categories and data ranges through that, however I do not know how to allocate my worksheet in the workbook as an object of type spreadsheet, as it seems they are two different things. Please could someone explain how to do this or point me in the right direction if im going completely the wrong way thanks!

Chris




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Read And Chart Excel Worksheet
I want to plot chart from Excel worksheet. I require VB codes which allow me to select flexible horizontal and vertical scales. Hope someones can help me.


Thanks,

Khoo Ho You

Chart Placement In Excel Worksheet
I'm trying to place a chart into an excel worksheet in a specific location.

Getting the chart into a worksheet is straightforward but I'm having a hard
time trying to place it.

I was hoping you could use cell addresses from the worksheet to guide where
you wanted to place the chart, but I don't know of a way.
For ex: If I wanted the location of the top left corner of my chart to be at cell A1

Any help would be appreciated, Thanks

Excel: How Do I Move A Chart On A Worksheet?
I can't get my chart to move. Here is my code:
Code:Private Sub PlotChart(rng2Plot As Range, Title As String, xPos As Long, yPos As Long)
    Dim NewChart ' As Chart
'
' CreateChart Macro
' Macro recorded 21/04/2005 by 08504629
'

'
    Charts.Add
    ActiveChart.ChartType = xlLineMarkers
' ActiveChart.SetSourceData Source:=Sheets("Summary").Range( _
' "A1,C1:AU1,A17,C17:AU17"), PlotBy:=xlRows
    ActiveChart.SetSourceData Source:=rng2Plot, PlotBy:=xlRows
    With ActiveChart
        .HasTitle = True
        .ChartTitle.Characters.Text = Title
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
        .Axes(xlValue, xlPrimary).HasTitle = True
        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Num Errors"
    End With
    With ActiveChart
        .HasAxis(xlCategory, xlPrimary) = True
        .HasAxis(xlValue, xlPrimary) = True
    End With
    ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
    With ActiveChart.Axes(xlCategory)
        .HasMajorGridlines = False
        .HasMinorGridlines = False
    End With
    With ActiveChart.Axes(xlValue)
        .HasMajorGridlines = True
        .HasMinorGridlines = False
    End With
    ActiveChart.HasLegend = True
    ActiveChart.Legend.Select
    Selection.Position = xlBottom
    ActiveChart.HasDataTable = False
    ActiveChart.Location Where:=xlLocationAsObject, Name:="GraphResults"
    With Worksheets("GraphResults")
        ColBLeft = .Columns("B").Left
        '.Range("A1").Select
        ActiveChart.ChartArea.Left = ColBLeft
    End With
End Sub


The line in question is "ColBLeft = .Columns("B").Left" with the error "Error 13: Type Mismatch". The current selection is the chart. If I select a cell on the worksheet, the line works OK. But then, if I continue to run the code, I get the error "Error 91: Object variable or With Block variable not set". How do I do it?

Pls consider that I might already have charts on that worksheet and I don't know the chart name.


|
+--JDMils
|
+--VB6
+--VB Dot Net
|
+-- Navman GPS Forums @ http://forum.jdmils.com
|

Want To Save Snapshot Of Excel Worksheet (pasted Values And Chart Data Etc)
Hi there,

I am trying to save an active worksheet into a new workbook which I have the code for:
Code:
    Dim strFile As String

    strFile = "C:.......filename.xls"

    Worksheets("Sheet 1").Select
    Worksheets("Sheet 1").Copy
    
    ActiveWorkbook.SaveAs strFile
    ActiveWorkbook.Close


However the saved sheet uses references to the original sheet which will be changed (I want new saved sheet to hold original values).

I have played around using paste values and came up with a roundabout way of doing it but there are also graphs on the page that don't work with paste values.

Is there a way of taking a snapshot of the values and charts at that point rather than using the formulas and series data.




Edited by - rickp101 on 12/17/2003 7:21:08 AM

Embedded Chart In A Worksheet And A Chart Exisiting On Its Own Sheet
what is the difference between a Chart embedded in a worksheet and a chart existing on their own sheets. i mean what is the difference between being embedded in a worksheet and existing on their own sheets.


i came across the statement on the MSDN site

Note Charts embedded in a worksheet are members of the ChartObjects collection, whereas charts that exist on their own sheets belong to the Charts collection.

Excel Worksheet On A Form
Hi!

I know this topic has probably been up before, but I couldn't find what I was looking for... sorry..

I have a form where I want to embed an excel worksheet. The worksheet is not supposed to be editable by the user, only display information from my Access database. Normally I edit the cells of an external worksheet like this:


Code:
Dim db As Database
Dim rs As DAO.Recordset
Dim XLApp As New Excel.Application
Set db = OpenDatabase(App.Path & "Database.mdb")
Set rs = db.OpenRecordset("SELECT * FROM [Product]")
XLApp.Workbooks.Open (App.Path & "Data.xls")
XLApp.Cells(2, 2).Value = rs.Fields("CustomerName")

Can anyone tell me how to embed a new excel worksheet on my form, so that I can read values from my database and display it like in the example above?

Thanks in advance!

Is This Possible: Excel Worksheet In Vb Form???
i have about 4 excel spreadsheets, and every one of them has a summary sheet.

what i want to do is create a program with a bunch of excel objects, and a timer.

at certain interval, the program will connect to the different spreadsheets and update its own excel objects...

can it be done???

thanks

Display Excel Worksheet In VB Form GUI
Hi,

If I want to display/load a Excel worksheet on the VB GUI, how could I do this. I tried the OLE but it does not do display.

My application is actually need to display the worksheet at the program GUI, user can do edit and save to the excel file.

Other altenative is please guide me on how to create a table on the GUI.

Thanks for helping!

Integrate A Form In An Excel Worksheet
hey,
is it possible to embed a form into an worksheet, like you can do it with pictures?

greets & thx
ben

Excel VBA - Form Controls On Worksheet
I have a form in a worksheet with several text box inputs(ActionItemForm). When I click AddActionItem button, I want it to fill in the data in the second worksheet(ActionItems).

The data in the second sheet is also pulling in values from a third worksheet so the columns aren't Contiguous.

The second sheet holding the values includes the following columns(ActionName, Description, Resolution, AssignedTo, Team, Status). I've found ways to add a new action item to the first row by using Get/Set method and named cells but, I haven't been able to add additional action items to the range(s). AssignedTo and Team are pulled from a seperate worksheet, I'm just trying to get the action item values right now. This should be able to hold 1000 action items and I should be able to retrieve these values to populate an update screen at a later date.

Thank you for any help you can provide. This is for a school assignment.

Link Excel WorkSheet Into A Form
Hi All,

I can achieve the above by using the OLE control in VB6, but I want to be able to edit the cells's direct from the VB form as well without having to load the Excel sheet seperately.

In an Access 2000 form you double click but again it opens a seperate instance of Excell to edit.

Is there anyway you can tab in the cell's etc and change figures on the Excell cells all from the form ?

Table In VB Form Behave Like Excel Worksheet
Hi, I want to make table in VB but the table must behaves like excel worksheet, for example : I can add, edit and erase text directly to every cell in the table.
Until now I make the table from textbox, but it will be difficult and confuse me if the table contains so many cells.
If anyone know the answer, please tell me.
Thank you

Excel VBA Load Values In Form From Worksheet
Sheet "Global" has a table of values, which I have load into a form (frmNew) after clicking a command button. Im using the below code to load the values from the sheet to the form, everything works great with the textboxes, but when it comes to loading the selecting the listbox values (lstAnswer1.Value, etc) it seems to miss about 3-4 of them each time and I cant figure out why.


Code:
frmNew.txtQ1A4.Text = Sheets("Global").Range("F5")
frmNew.txtQ2A4.Text = Sheets("Global").Range("F6")
frmNew.txtQ3A4.Text = Sheets("Global").Range("F7")
frmNew.txtQ4A4.Text = Sheets("Global").Range("F8")
frmNew.txtQ5A4.Text = Sheets("Global").Range("F9")
frmNew.txtQ6A4.Text = Sheets("Global").Range("F10")
frmNew.txtQ7A4.Text = Sheets("Global").Range("F11")
frmNew.txtQ8A4.Text = Sheets("Global").Range("F12")
frmNew.txtQ9A4.Text = Sheets("Global").Range("F13")
frmNew.txtQ10A4.Text = Sheets("Global").Range("F14")

If Sheets("Global").Range("G5") <> "" Then frmNew.lstAnswerQ1.Value = Sheets("Global").Range("G5")
If Sheets("Global").Range("G6") <> "" Then frmNew.lstAnswerQ2.Value = Sheets("Global").Range("G6")
If Sheets("Global").Range("G7") <> "" Then frmNew.lstAnswerQ3.Value = Sheets("Global").Range("G7")
If Sheets("Global").Range("G8") <> "" Then frmNew.lstAnswerQ4.Value = Sheets("Global").Range("G8")
If Sheets("Global").Range("G9") <> "" Then frmNew.lstAnswerQ5.Value = Sheets("Global").Range("G9")
If Sheets("Global").Range("G10") <> "" Then frmNew.lstAnswerQ6.Value = Sheets("Global").Range("G10")
If Sheets("Global").Range("G11") <> "" Then frmNew.lstAnswerQ7.Value = Sheets("Global").Range("G11")
If Sheets("Global").Range("G12") <> "" Then frmNew.lstAnswerQ8.Value = Sheets("Global").Range("G12")
If Sheets("Global").Range("G13") <> "" Then frmNew.lstAnswerQ9.Value = Sheets("Global").Range("G13")
If Sheets("Global").Range("G14") <> "" Then frmNew.lstAnswerQ10.Value = Sheets("Global").Range("G14")

frmNew.txtIncorrectQ1.Text = Sheets("Global").Range("H5")
frmNew.txtIncorrectQ2.Text = Sheets("Global").Range("H6")
frmNew.txtIncorrectQ3.Text = Sheets("Global").Range("H7")
frmNew.txtIncorrectQ4.Text = Sheets("Global").Range("H8")
frmNew.txtIncorrectQ5.Text = Sheets("Global").Range("H9")
frmNew.txtIncorrectQ6.Text = Sheets("Global").Range("H10")
frmNew.txtIncorrectQ7.Text = Sheets("Global").Range("H11")
frmNew.txtIncorrectQ8.Text = Sheets("Global").Range("H12")
frmNew.txtIncorrectQ9.Text = Sheets("Global").Range("H13")
frmNew.txtIncorrectQ10.Text = Sheets("Global").Range("H14")

Placing Data From Form Into OLE Excel Worksheet
I want to be able to place data from a textbox or list box into an excel worksheet. I have opened an OLE control and assigned my excel worksheet to it.
My question is how do I move my data from the form into specific cells on the worksheet.
I am using vb5 in win98.
any help would be appreciated.

Embed An Excel Graph And Worksheet In A Form
hi~

I would like to embed an excel graph on a form. Moreover, if a "show data" button was pressed, the data of the excel graph can be shown in a datagrid.

p.s. :The excel graph is generate at run time by OLE.


I have read some books of visual basic 6.0, there is an OLE icon in the toolbox; however in vb.NET, the icon cannot be found. Is the function of OLE embedding is being removed in vb.NET?

Editing Excel Worksheet On A VB Form And Saving It
Hi all,

Posted this yesterday, but I still cannot find out how to to the above, I have managed to use the OLE tool to embed the spreadsheet on the VB form, but there I can't see away of saving the spreadsheet back to its original .XLS file, only as an OLE data file ?

I can also use a reference to the Excel object library but this opens up an complete Excel Instance in a seperate window, same when using the Linked option on the OLE control. I can't believe its not possible to embed an Excel worksheet on a form and simple be able to edit it and save it back, surely . . .

Please can anybody help ?

Linking Combox In Excel Form To Range On Another Sheet
Excel 2007

I have two sheets, on the first I have a form that I call up and in this form I have two radio buttons that when clicked I want to populate the values of a drop-down combox box. Basicall I have the following code written. I think it's real clsoe but the data I want to fill the combo box with is on the second sheet. How do I call out the range on the second sheet to populate the box in a form on the first sheet?


Private Sub StateMNRadio_Click()
    If Me.StateMNRadio = True Then
        Me.ComboBoxSignCompany.RowSource = Worksheets("DataSheet").Range("A2:A100").Value
    Else:
        Me.ComboBoxSignCompany.RowSource = Worksheets("DataSheet").Range("B2:B100").Value
    End If
End Sub

Faster Access To Form Controls On Excel Worksheet?
ralan@charter.net

My client has worksheets with as many as a few thousand Form controls such as radio buttons on them. The radio buttons are organized within Excel form Frame controls.

At various times I need to find out which controls are related to each other (contained in the same frame). What I'm doing now is looping through the entire control collection looking for radio buttons whose GroupBox.Name equals whatever frame I'm dealing with. When there are thousands of controls on a worksheet and you're only looking for a handful, this is extremely time consuming and feels like a major performance problem to the user.

Is there anyway that I can somehow query excel to return to me the exact list of controls
contained in the frame of my choice without having to loop through the entire control collection?

This is an important issue on the project I'm on and a slick answer to this would be greatly appreciated.

Thanks in advance,

Rob Alan

 

Excel VBA - Passing Values Between User Form And Worksheet
Hi,

I would like to have a text box in a user form and allow the user to enter text into the text box, which will be passed to a label(lblName) in a worksheet("View Data").

Is this possible?

In addition, is it possible in Excel to select a button on sheet1 which will hide sheet1 and display another sheet i.e. sheet 2?

Many thanks in advance for any help or suggestions.
natalie

 

Excel Chart In VB6 Form
Did you have any answer to your question yet? I'm trying to do the same thing. Any help?

Thanks

http://www.xtremevbtalk.com/showthread.php?t=132973

Quote:





Originally Posted by acktarus


I just added a component from the list of components and it's called :"Excel Chart". When I added it, it comes like an excel chart that you can modify. If you double click on it, a small spreadsheet apears so that you can change de values to what you want. My question is how can I change those values from within the program, so that the graph can change form when the user click for on different data for exemple.

Excel Chart On VB6 Form
Hi, I have an excel chart saved on my C drive. All data is save in the same folder. I would like to show the chart or display it on my VB6 Form Screen or main screen. What would be the way to do that? Do I need a Picture box to do this? Is there a link with information on how to do this?

Thank you!

Chart On A Form In Excel
Hello. I am working in Excel 2003. I have buttons on each worksheet that will open various little forms when clicked. My problem is that I want to have a chart on one of the forms but I can't figure out how to do this. I tried creating a ChChart object in the UserForm_Initialize() subroutine, but I couldn't get anything to work. Any suggestion on the basics of this?

Thanks,
bungee41



Edited by - Geof on 7/7/2006 6:24:41 PM

Problems Linking With Office 2003
Hi guys, here´s an up-to-date problem: I had an exquisite program running, and linked to excel XP (nothing great, just passing some data), but now that i´m trying to run it with excel 2003, it brings "error 285: DDE cannot performe action" or something like that. What is this? And more important, how can i fix it?

Linking Multiple Office Applications
I have done some programming in the past with C++ and VB but am having a hard time fine the specific VBA code that I need to do the following...

I have a website where people enter in their information into a form. The information is then e-mailed to me. I copy that information out of the e-mail and then paste it into an excel spread sheet. From there VBA sorts the informaiton, creates an invoice and an e-mail is generated for the person but I have to copy the text out of excel and then paste it into a new outlook message. Here is what I would like to do with VBA..

When that specific e-mail is sent to me I would like it to copy all of the information out of the e-mail, paste it into the excel spread sheet and then e-mail the person back. Any ideas? Now I understand that I am looking for quite a bit of stuff here so sample code would be great but also some good websites with sample code on them would also work out great for me. I appreciate any help that you could give me.

Tranfering Variables Form VB6 To Office Access Or Excel And Back
What is the best way go transfer variables form VB6 to Excel or Access
VBA then tranfer them back to VB6?
I have been tranfering varibles from VB6 to office 2000 Access or Excel by
saving the variables to a file on my hard dirve. I would use the VB6 to
save a variable to a file. Later on when I want to use that variable in
Access or Excel 2000 VBA I would open up that same file and read it
into VBA. In this case my variable is a path name created in VB6. My orginal VB6 program may or may not be running when I use that variable in excel
or Access VBA.
This method works but don't know if it is a convential way of doing
it. So what is the proper professional method of doing this task? What
is the most easy way of doing this task? What if someone had a series
or array of variables to tranfer? What would be the best method to do that?
thank you,

Help W/simple Transfer From Vba Form Field To Excel Worksheet Cell
Hey, I've got a real simple problem I can't get my head around. I'm just trying to copy or take data entered in text boxes (in a VBA form) and put it into a cell in a worksheet. Specifically, when the user clicks the "compute" command button I want the data from the text boxes copied or sent to excel cells.

Here's the code so far:

Code:
Private Sub cmdCompute_Click()
            
    Dim strFilePath As String
    strFilePath = "C: emp.xls" 'workbook to receive data from text boxes

    Dim xlApp As Excel.Application
    Dim xlBook As Excel.Workbook
    Dim xlSheet As Excel.Worksheet
    
    Set xlApp = New Excel.Application
    Set xlBook = xlApp.Workbooks.Open(strFilePath)
    Set xlSheet = xlBook.Sheets("Sheet1") 'worksheet to receive data
    
    xlSheet.Activate
    Range("A1") = frmMain.txtDate.Text 'data being transfered is from main form and text box "txtDate"
    Range("B1") = frmMain.txtMajor.Text 'same as previous line, but different text box
    xlApp.Visible = True
    
End Sub


Thanks for your help.

(Resolved)Excel Chart On VB Form..
I have a post already calle Excel Through VB.. I wanted to post a new thread to try to get the answer I ma looking for...

I have a excel workbook that contains a Sheet1, and Chart1.. I take some values from the VB form Textboxes, and then put those values into sheet1. I then want to plot a chart and show that chart on a VB form What is the best way to do this..

At the this time I am able to get the values to Sheet1, but my chart never gets updated on the form. I am not sure what is the proper way to do this I am using an OLE to show my chart on the VB form... Please help......

I just need to understand on how to show the chart on the VBform, after the values have been added...

Embedding Excel Chart On VB Form?
I just started to program using Visual Basic 6.0 and have a basic question (No pun intended).

Currently, I have a ListBox on my main form. I would like to be able to select an item in the ListBox and have an Excel Chart be displayed to the right of the ListBox. In addition, the chart(s) that I would like to display is/are already in a seperate Excel file located on the C drive.

I tried using an OLE but I could not get the chart to be displayed in the window.

Help.

Excel Chart Object In VB6 Form
Well, this IS the "Newbie" forum, so here's a newbie question...

I added the "Microsoft Excel Chart" Insertable Object component to my VB6 project and it added that new button to the Toolbox. When I used to button to add a chart object to a form, I got an object "Chart1". Right-clicking this object and selecting Edit reveals an Excel 'workbook' with a default chart on sheet 'Chart1' and the data producing the chart on 'Sheet1'.

This is probably not news to any of you, but my question is, now that this obejct is in my form and I've edited the chart to look like I want it to look, how do I 'talk' to it? In other words, using the VB form's objects and user interaction how can I alter the data in this Excel chart object to update the chart as needed? A hypothetical example... I want a value entered into a text box 'myTextBox' on my VB form to be copied into cell B1 of Sheet1 in the embedded workbook.

Can this be done?

Thank you,

Gary Lofgren

Import Excel Chart Into VB Form, PLEASE HELP!
Ok ladies and gents, I'm not if it's possible to even do this but I need to import several excel charts into a form, just for displaying. It's easier to create the charts in excel and then import (i think). I have more control in excel with the design. Well, now i have to figure out how to import them. Is this possible? if so, how?

I already have this declared but where do i take it from here?
Code:Dim XL As Excel.Application, XLW As Excel.Workbook, XLS As Excel.Worksheet
Set XL = New Excel.Application
Set XLW = XL.Workbooks.Open(filename)
Set XLS = XLW.Worksheets.Item(1)


thanks everyone!
Essa

Excel VBA - Graph/Chart On User Form
Good morning ladies and gentlemen,

I would like to start off by saying that I have been searching high and low for a solution to the following problem. Some of the solutions I’ve found on this site and others are either to difficult or not exactly what I’m looking for.

I would like to see an example of the following….

I would like to be able to place a graph/chart on a user form so that data can be displayed in real time. This would be like having a strip chart showing data from a data logger. Data is stored within the spreadsheet and a new row of data is added every n number of seconds/minutes (user defined scan rate). I have the incoming data setup and working flawlessly, I would just like to be able to reference a few cells and graph them on a user form every time new data is brought into the spreadsheet.

Any help I can get would be greatly appreciated.

Thanks!

Show An Excel Chart On A User Form On VBA
hi,
how can i insert data to a data grid or an excel sheet and than show it in a chart onmy form, without the need to open excel application???

How To Copy A Chart From Excel And Show It In A VB Form?
how can we copy a chart from excel and show it in a picture box in a form in Vb.
can anyone provide me with the code for this..

thanks.

VBA Unexpected Exit After Upgrading From Excel 10 To 11 (Office XP To Office 2003)
My work computer just went from a Office XP to an Office 2003 upgrade and some problems just started.

The following code is kept in my "personal.xls" workbook and is started by a custom macro button in Excel. It used to work fine until the Office upgrade.
It's pretty straight forward and easy to follow. Where I have the comment "stops here ?????" is where the code stops executing. There is no alarms or warnings. I have the macro security settings on low. Am I missing a DLL file in the references or something???

Code:Sub refresh
    'closes and reopens active workbook
    'version 7.012.w
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Dim cBook As String, cSheet As String
    Dim cColumn As Integer, cRow As Integer

    cBook = ActiveWorkbook.FullName
    cSheet = ActiveSheet.Name
    cColumn = ActiveCell.Column
    cRow = ActiveCell.Row

    ActiveWorkbook.Close
    Workbooks.Open cBook

    'stops here ??????

    Application.ScreenUpdating = True
    Worksheets(cSheet).Activate
    Cells(cRow, cColumn).Select
    Application.DisplayAlerts = True
End Sub

<Edit> Lankymart - Added code tags for readability. </Edit>



Edited by - kschauer on 2/12/2007 6:25:15 AM

Newbie - Office Chart 9.0
Hi - I'm trying to use the Office Chart 9.0 object (comes up as AxChartSpace1) to make a line chart using an array as the values. Has anyone used this? Is there some documentation on this object? This is for .net.
Thanks very much!
Go easy - I'm new to VB!

MS Office Chart Components 9.0
Hi,


I have used Ms office Chart components for making pie graphs in VB....everything works fine except that the labels appear inside the pie graph... i want to position them outside the pie charts else they overlap each other ........there are some commands to change the datalabels position....which i tried using......but doesnt show any effect........all other properties for data labels like color , style etc for the pie chart changes as required except for the label positions....
I am confused.......

Help!!!

How Could You Know If The Sheet Is A Chart Of Worksheet
I am going to make a loop like this:

For i = 1 To excel_wb.Sheets.Count

'my code here

next i

How can i know during this loop if the sheet is a worksheet or a chart? So it would be like this:

For i = 1 To excel_wb.Sheets.Count
if (sheet is a worksheet) then
'do this
else
'do that
end
next i

Chart Value Axis Title Linking
Hello,

is there a way to link the value axis title in a chart to a specific cell through VB or otherwise? I would need to change the title of the y-axis title according to a currency (e.g. USD, EUR...) set in a cell... Is it possible?

Thanks...!

How To Copy A Chart From One OLE Excel Sheet To An OLE Excel Chart Object
Hi all,

Kinda stuck here and I have been searching for the way to do this all day. I have a spreadsheet with Charts in one VB OLE container (Excel.Sheet.8)and I want to copy one of the charts to another VB OLE container (Excel.Chart.8) and have it sized to fit in my OLE container. I cant seem to get it to work. Any help?

Where OLE1 = spreadsheets with charts
and OLE2 is a chart

Code:
OLE1.Class = "Excel.Sheet.8"
OLE1.SourceDoc = App.Path & "Data5.xlt"
OLE1.Action = 0
'... Work with the spreadsheet...
OLE2.Class = "Excel.Chart.8"
OLE2.Action = 0
Set OLE2.object = OLE1.object.Charts(1) 'Doesnt Work
OLE2.object.Height = 5000 'Doesnt Work
OLE2.object.Width = 10000

Creating A Dynamic Chart From A User Form In Excel (Just A Start Please)
Hi Guys I have to do this

Task 2: Spreadsheet
Keerside Primary school has a weather recording project that is undertaken by the infant classes. At noon each day pupils record the rainfall for the last 24 hours and the temperature at noon. These two figures are entered into a spreadsheet and used to produce a graph showing both rainfall (as a bar chart) and temperature (as a line graph) for the calendar month. The spreadsheet also calculates the average rainfall and temperature for the month so far.
Because the spreadsheet is to be used by infant children the school want an interface that is simple to use and does not require the pupils to enter data directly into the spreadsheet. Your task is to create a user form in VBA which is automatically displayed when the spreadsheet is opened and which allows the pupils to select the month and date in the month from combo boxes and to enter the rainfall and temperature into text boxes. Once this is done the pupils can select a command button to transfer the data into the correct worksheet (there should be one for each month) and then display the sheet showing the weather recordings for the month, the graph and the averages. From the sheet the pupils should be able to quit the spreadsheet using a command button.
For this task you only need to include sheets and write VBA code for January, February and March. You should hand in a copy of your spreadsheet on disk.


Any help would be greatly appreciated

venture






Edited by - venture on 8/31/2003 8:29:35 AM

Chart - Microsoft Office Web Components 9.0
Anyone can guide me to create chart by using Microsoft Office Web Components 9.0.

i found a website that provided the step to create it --> http://support.microsoft.com/kb/235885/EN-US/
but i get an error on "WCChart" and "WCSeries".


Thanks for help.



Edited by - yuen on 4/23/2008 7:36:37 AM

VB Code For Add Bar Chart Onto Existing Worksheet
Currently I am using VB6 for excel, which is to automatic generate a bar chart in a worksheet. I was using the "help" and working on the following code "
With Charts.Add
.ChartWizard Source:=Worksheets("sheet1").Range("a1:b13"), gallery:=xlBar, Title:="Customer Order"
End With" But I am not sure whether I am on the right track.
Hope someone could help!

Find The Position Of A Chart In A Worksheet
Hi there

I want to find the position of a chart in a worksheet (probably by finding the cell reference for it).

Is this possible? If so, how?
Note i have many charts on one worksheet and i will need to loop thru them all and find the position of each one!

Here is my attached code so far:

Function chartposi(chartname As String) As String
    Dim a As String
    Windows("CLEAR Cabinets.xls").Activate
    ActiveSheet.ChartObjects(1).Activate
    ActiveChart.ChartTitle.Select
    name = ActiveChart.ChartTitle.Text
    With ActiveChart
        .HasTitle = True
        .Position = ActiveSheet.Cells(a36) '<----- i dont think this line actually works!
    End With
End Function



Edited by - kristy2710 on 6/3/2004 1:38:48 PM

Why The New Chart Cannot Be Added After The Last Worksheet Of A Workbook...???
At first, I use the following code to create a new workbook in Excel2002.

Dim appExcel As Excel.Application
Dim wbExcel As Excel.Workbook
Dim shExcel As Excel.Worksheet

Code:Set appExcel = CreateObject("excel.application")
Set wbExcel = appExcel.Workbooks.Add
And then use the following to add a Chart after Worksheets(3), the last Worksheet in Workbook.

Code:appExcel.Charts.Add after:=wbExcel.Worksheets(3)
I have confirmed that there are only three Worksheets in Workbook, and they are Worksheets(1), Worksheets(1) and Worksheets(3), respecitely. Their arrangement from left to right is: Worksheets(1), Worksheets(2) and Worksheets(3).
However, the new Chart will be added before Worksheets(3) using the above-mentioned code. The same problem won't happen when I change Worksheet(3) into Worksheet(1) or Worksheet(2).

I know I can use Code:appExcel.Charts(1).Move after:=wbExcel.Worksheets("Sheet3") to solve the problem. But I am very curious of why the original code doesn't work.

Linking A Series In A Chart To A Specific Word
Hello,

I've got a list of countries with various different totals against them. I've created some top 20 graphs and each time I do it the lines are different colours for the countries which means that when you compare them you're looking at one color for a country in one graph, then if you look at that same color line in another graph its a different country.

I was wondering if it was possible to link a series to a country so that when you draw a graph the chart knows which color to make that line.

Hope this makes sense. Any help would be most appriciated

Cheers

Insert A Chart In A Worksheet That Has Variable Entries.
I am working on an excel spreadsheet (attached) and am having a problem with the "Insert Chart" Macro I am trying to create. I'm not really too sure how to approach this but if you look at the code I've written so far you may be able to tell me if I'm on the right track or not. The other macros in the sheet all work OK. When I run "insert new mechanic" and add data I need the chart to reflect this. Also I don't need the data in the second column ("B") to be included in the chart. As you can see I've fiddled around with the coding a fair bit but as yet have not come up with a solution. I would appreciate any help. Please see attachment.

URGENT-URGENT::Making A Excel Chart In VB Form From MSHFlexGrid &amp; Displaying It
I have the following problem:

Making a Excel chart in VB Form from MSHFlexGrid & Displaying it[]

 - can some one help please!!



 

Draw Bar Chart ,pie Chart In Excel Using Vb
i want to draw pie,bar chart in excel using vb. database is ms access. pls advise me.

Microsoft Office Object Library Excel 2003 And Excel 2000
Ciao Gurus,

I have developed an application with excel 2003 and, of course, it takes as reference the library of excel 2003, but most of the users have excel 2000 and the application goes in error when this reference is called. The library is Microsoft Outlook that in excel 2003 is 11.0 version while in excel 2000 is 9.0.
How can I fix the problem?
Best Regards
KAIALA


 

Edited by - kaiala on 7/2/2007 3:21:56 AM

Copyright © 2005-08 www.BigResource.com, All rights reserved