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




OLE VB Embedded Excel Chart


Hi everyone,

I am using a OLE Embedded Excel Chart in A VB form. I am using it as a ScatterXY plot. I am able to set the axis and data in the associated sheet1 at design time but I don't know how to change data in the associated sheet1 for the graph at run time.
Nothing seems to work. Any help would be greatly appreciated.
Thank You.
Charles

 




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Embedded OLE Excel Chart Object.. DYNAMIC??
Is it possible to make the OLE Excel Chart object dynamic? I chose to make a chart using this object instead of instantiating a Excel.Chart and creating one from scratch. Now I'm concerned that I can't make if I want these to be dynamic then it can't happen.
What I do is use the OLE excel chart object and then edit it by filling in the excel spreadsheet with the data and then graphing and only displaying the graph as a sheet.

Hopefully someone can help me with this. I'm sure there are VB/OLE Excel guru's out there.


Thanks!
Essa

Embedded OLE Excel Chart Object.. DYNAMIC??
Is it possible to make the OLE Excel Chart object dynamic? I chose to make a chart using this object instead of instantiating a Excel.Chart and creating one from scratch. Now I'm concerned that I can't make if I want these to be dynamic then it can't happen.
What I do is use the OLE excel chart object and then edit it by filling in the excel spreadsheet with the data and then graphing and only displaying the graph as a sheet.

Hopefully someone can help me with this. I'm sure there are VB/OLE Excel guru's out there.


Thanks!
Essa

Using Excel Chart Event Procedures When Embedded In PowerPoint
Hi,

Say I've declared a procedure in Excel, with a chart on a seperate sheet, that msgboxes what the value of the series is when you mouseover it, something like this:

>>



Private Sub Chart_MouseMove(ByVal Button As Long, _
ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
Dim IDNum As Long
Dim a As Long
Dim b As Long

ActiveChart.GetChartElement X, Y, IDNum, a, b
msgbox IDNum
end sub



>>>.


If I paste this chart into Powerpoint I have not found an easy way to access this prcoedure. I know you can set ActionSettings and I suppose you could call another sub that is given a reference to the shape.oleformat.object, but this seems far too hard.

Any thoughts?

Thanks alot,

Greg

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.

Can't Deactivate Ole Chart Embedded In Word
All,

I can insert and manipulate an Excel Chart in word using the following code:

wd.Selection.InlineShapes.AddOLEObject ClassType:="Excel.Chart.8", FileName:= _
"", LinkToFile:=False, DisplayAsIcon:=False
numPlots = wd.ActiveDocument.InlineShapes.count
With wd.ActiveDocument.InlineShapes(numPlots).OLEFormat
'.Activate
Set objC = .object
End With

However, when I'm done doing stuff to the Excel Chart, I can't seem to write code to deactivate the ole object. It just stays activated (e.g. displayed as a workbook with a chart sheet and a worksheet). I can actually do stuff in Work programmatically while the Excel Chart is activated, but I wish to close/deactivate the chart so that the users sees only the ole chart.

Any help would be appreciated. Thanx!

Defining FONT In Legend Of Embedded Chart
Hi, I've got a macro which generates 4 charts embedded in a worksheet and publishes them as web pages. Problem I have now is that the legend FONT is too big and for the (24) lines of the bar chart not all items show. I'd like to be able to define both the FONT and FONT SIZE to be used within the legend so I can fiddle it to fit. Anyone able to help?
Thanks, Tom

Embedded Chart Selected - Workbook Deactivate Event Not Triggered In VBA
It seems that if you have an embedded chart selected on a worksheet that the Workbook_Deactivate() event is not triggered.

Originally I thought this behavior was a coding error, so I set up a simple sheet with 1 chart on it and the Workbook_Deactivate() and Workbook_Activate() events with a Msgbox command in both events to indicate when I enter them. Turns out that if the chart is selected, the Workbook_Deactivate() event doesn't trigger when switching workbooks, but the Workbook_Activate() event does trigger when coming back in. When the chart is not selected, both trigger. This is really non-intuitive to me as you can't set a chart event on an embedded chart without creating an event class (as far as I know).

I did create an event class just to check it out and it works (myChartClass_Deactivate()). However, that means I would need to set every embedded chart in my workbook to the class??? and also set a Workbook_SheetActivate event to catch for when I just deselect a chart and do not leave the workbook ("If ActiveWorkbook.Name <> ThisWorkbook.Name Then ..." works as I only care about the chart deactivate event to indicate that I left the workbook).

This can't be correct. Am I missing something here or is that what you really need to do?

thx in advance

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

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.

Excel Embedded In OLE Box
Hi,

I have an OLE box and a save button on my VB form with the following code


Code:

Option Explicit

Const OLE_CreateEmbed As Long = 0
Const OLE_Activate As Long = 7
Const OLE_Close As Long = 9

Dim WithEvents LGRExcel As Excel.Workbook
Dim shtLGR As Excel.Worksheet

Private Sub cmdSave_Click()

Dim FileNum As Integer

'get file number
FileNum = FreeFile

'Open the file to be saved
Open "C:WebLOLERLGR.xls" For Binary As #FileNum

'Save the file
oleExcel.SaveToFile FileNum

'Close the file
Close #FileNum
'oleExcel.SaveToFile "C:WebLOLERLGR.xls"

End Sub

Private Sub LGRExcel_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
If Val(Right(Target.Address, 1)) < 3 Then

'do nothing

Else

MsgBox "Changed Range = " & Target.Address & vbCr & vbCr & _
"New Value = " & Target.Text

End If

End Sub

Private Sub oleExcel_GotFocus()

oleExcel.Enabled = True
oleExcel.SourceDoc = "C:WebLOLERLGR.xls"
oleExcel.Action = 0

With oleExcel.object

.ActiveSheet.Range("A2").Value = "Item Description"
.ActiveSheet.Range("B2").Value = "Detailed Description"
.ActiveSheet.Range("C2").Value = "Item Code"
.ActiveSheet.Range("D2").Value = "SWL"
.ActiveSheet.Range("E2").Value = "Serial No."
.ActiveSheet.Range("F2").Value = "Model"
.ActiveSheet.Range("G2").Value = "Plant ID"
.ActiveSheet.Range("H1").Value = "Details of Manufacture"
' shtLGR.Range("H2").Value = "Name"
' shtLGR.Range("I2").Value = "Certificate No."
' shtLGR.Range("J2").Value = "Date"
' shtLGR.Range("K1").Value = "If Load Tested"
' shtLGR.Range("K2").Value = "Proof Load"
' shtLGR.Range("L2").Value = "Load Test Certificate No"
' shtLGR.Range("M2").Value = "Status"

' With shtLGR.Shapes
'
' .AddLine(0,0,74,74)
'
End With

End Sub
If I type something in the embedded excel sheet and press the save button, it saves the file as Excel file. When I try to open the Excel file there is an error message "This file is not in a recognizable format" and if I press "OK" button in the message it shows the file with lots of characters which are not typed.

In my references "Microsoft Excel 11.0 Object Library" is ticked. I am working on Windows XP professional with MS-Office 2003

What is the problem. Can anyone please help

Regards

Varrey

Embedded VB And Excel. Help Me Please
I need to find out how to create an pocket excel spreadsheet using embedded VB 3.0 on a pocketpc. Could someone help me out or at least point me in the right direction? thanks

Vb With Embedded Excel
I have an application with an embedded Excel spreadsheet. This works fine except when the user already has Excel running. When the VB app runs, my users cannot return to their original spreadsheets on their desktop until they click outside of the OLE container. Is there a way to launch a second instance of Excel so that my users can move painlessly between the two applications?

Embedded Word In Excel
Hi i have and embedded word document in excel sheet. When i use "open" verb
on embedded document in excel,it will open this document for editing in
microsoft word.
Is there any posibility to detect in word vba that this is embedded document
in excel sheet?


Tnx,Milos Vukov

Office 2k -> 2k3
Vb6,sp6
-------------------------------------------
Make word speak to you!
-------------------------------------------

Flexgrid And Embedded Excel
Hi guys, I'm having a little problem in my project: I have an mshflexgrid in a form that loads datas at runtime, based on a user selection. Once the datas are loaded the user presses a button and the informations fill in an embedded excel sheet on another tab.
Now, I can't get it to fill the information in the appropriate spaces of the excel sheet.
The code should basically:
-run through the second column of the flexgrid, take the first or the last row and transfer the information to the sheet;
-move to the next or previous cell in the same column (of the flexgrid) and compare: if the text is the same, fill the same column in the sheet, else move to another column.
-loop until there are no more rows in the flexgrid column.

The problem right noe is that it runs through the column, but fills always the first column of the excel sheet. In other words I'm missing the second step ('cause I don't really know how to do it....)

Here's the code

Code:
Dim MSH As MSHFlexGrid
Dim strEvent As String
Dim s As Integer

Set MSH = Me.MSHFlexGrid3

With Me.Spreadsheet1
For s = 1 To MSH.Rowsel
strEvent = MSH.TextMatrix(s, 2)
.Cells(6, 2) = strEvent

Select Case MSH.TextMatrix(s, 6)
Case "Saturday"
.Cells(10, 2) = MSH.TextMatrix(s, 7)
.Cells(10, 3) = MSH.TextMatrix(s, 8)
Case "Sunday"
.Cells(11, 2) = MSH.TextMatrix(s, 7)
.Cells(11, 3) = MSH.TextMatrix(s, 8)
Case "Monday"
.Cells(12, 2) = MSH.TextMatrix(s, 7)
.Cells(12, 3) = MSH.TextMatrix(s, 8)
Case "Tuesday"
.Cells(13, 2) = MSH.TextMatrix(s, 7)
.Cells(13, 3) = MSH.TextMatrix(s, 8)
Case "Wednesday"
.Cells(14, 2) = MSH.TextMatrix(s, 7)
.Cells(14, 3) = MSH.TextMatrix(s, 8)
Case "Thursday"
.Cells(15, 2) = MSH.TextMatrix(s, 7)
.Cells(15, 3) = MSH.TextMatrix(s, 8)
Case "Friday"
.Cells(16, 2) = MSH.TextMatrix(s, 7)
.Cells(16, 3) = MSH.TextMatrix(s, 8)
End Select
Next
End With

Embedded Objects In Excel
Hi All,
I wish to search all occurences of the word "Thomas" and replace them with "XXX" in all worksheets of an excel file. I have been successful in writing the code for this.

However, I have noticed that my excel workbook may have numerous embedded word documents where the word "Thomas" may occur.

Please can someone help me write the code which can go into these embedded word documents and do the search/replace.

Any useful leads will also be appreciated.
thanks,
thevbgirl

Embedded Excel Sheet In Vb
Hi,

I need the user to be able to edit a spreadsheet without all the excel menu commands at the top. I figured the best way to do this was to embed the required sheet into a form. However, when I do this, vb seems to resize the ole container based on the size of the first sheet in the workbook. Unfortunately, the first sheet is empty and the sheet I need edited is the third one. This causes the ole container to be very small in size.

Is there anyway to get around this?

Thanks

rob

Embedded Excel Window
I have an OLE window in a form. I have opened a CSV file in the window , which opens an Excel Sheet in my OLE window. The problem is the Excel window is longer and wider than my defined OLE window. I would like to make the Excel window fill the OLE window without going over. How can I do this?

I created the excel window like this:

ole1.CreateEmbed spath, "Excel.Sheet"

How can I set this up?

Embedded Objects In Excel
Hi All,
I wish to search all occurences of the word "David" and replace them with "XXX" in all worksheets of an excel file. I have been successful in writing the code for this.

However, I have noticed that my excel workbook may have numerous embedded word documents where the word "David" may occur.

Please can someone help me write the code which can go into these embedded word documents and do the search/replace.

Any useful leads will also be appreciated.
thanks,
Lonely

Embedded Objects In Excel
Hi,

I think that this is a simple problem!!!

I am using Excel97 under Windows98

I have inserted a Spinner in a Worksheet (embedded control from Forms tool bar) and I now need to get at it. I have tried many times but each time the "set" fails.

     Dim spcon as SpinButton ' this line usually Ok

     Set spcon = ????????? ' This line fails (the button name is Spinner2)
                                         Worksheet name is Dimensions

What is the syntax of the Set statement ???

Any help much appreciated

Erics

Macros In An Excel Doc. Embedded In A Word Doc.
Hi,

I have a problem regarding macros in embedded documents.

I have an Excel worksheet that contains a macro. I also set a button to run that macro when it's cliqued.

When I insert the Excel worksheet into Word (97 by the way), with the options { link NO, icon YES }, my button doesn't work anymore...

I mean, when I open the document, I choose "Yes, activate the macros". Then Excel is run, and the workbook is named "Feuille de calcul dans C: WINNT Profiles XYZ Bureau Planning.doc" (yeah right, it's a french version ).

The button is still linked to the macro, but it won't do anything.
Still, when I open the VBA Editor, I can run the macro by clicking on the Run button.

Is there something with embedding that disables buttons ?
Weel, any idea is welcome, I'm completely stuck

Thank you

~bigquick~

Update An Embedded Excel Sheet
hi, how can i update an embedded excel worksheet data in microsoft word? I'm using userform to obtain the user input. For example, i write down "How are you?" within the textbox and press the "ok" button, the value of that textbox should be printed on the embeded excel worksheet (for example at range A1). How can i do that? please help me.

Embedded WebBrowser Text To Excel
I have embedded a WebBrowser control on my Excel worksheet, and it works great. Now I don't have to flip between Excel and IE while I am surfing through data bases.

What I would like to do now is make Excel automatically copy the contents of the current web page to Excel as soon as the page loads. I made it work beautifully on one of the company databases, and everyone thought it was slick. It was simple to use webbrowser1.document.documentelement.innerhtml to get everything from the page, and then strip html tags while parsing for the data text and the color of the text (color of text is important).

Now they want me to do it for another database, but this DB web page has two frames. One is a navigation frame, while the other is the data frame. I don't care about the navigation frame, but I don't know how to access the html from the data frame. If I use the same method as above, I get just the navigation frame and not the all important data frame.

Does anyone know how I can get the HTML from the data frame? The name of the data frame changes, but it is always onne of 27 different titles. I have not yet figured out how to get the title of that frame, otherwise it would again be an easy task.

Controlling An Embedded Excel In Word
For the life of me, I can't figure out how to determine the name of an Excel sheet which is embedded in my Word document. Without the name of the spreadsheet, I have no idea how to control it. This should be simple enough but I can't record a macro to provide me with some leads. I've attached the document to this message. Maybe someone can tell me how to control and insert some values in the spreadsheet from a separate VB app.

Thanks! Mike

Working With Embedded Excel In Word
Hello all.

I'm new here but hope to become an active participant.

Here is my first question:

We are working with embedded excel tables in word. (Office 2003) Specifically we have a macro which runs through and converts them over to word tables. While we are doing that, before it converts over, I would like to run a search and replace.

What is the syntax for doing this when we are working with Embedded Excel via a word macro?

Thanks all!

About Sharing Excel File Embedded With Vba...
Hi there. I got an excel file for maintaining employee's leave records. What I want is that the file will be saved in one of the five machines which have been connected via an intranet and so all the five employees can have access to the same excel file and have their leave records enquired and maintained. When user opens the file, my vba will prompt the user for a password and if it is proved to be valid, only the records of the user who logs in will be displayed for enquiry and update.
....And the problem is: How do I make the excel file shared for the 5 users, even at the same time?

Please give me some advice and solution.

Cheers.

Excel Sheet Embedded In Form
I am writing a code in VB6 and I want an excel sheet to be embedded in one of my forms. I tried using the code from other threads but when i say exob.visible = true, it shows the excel sheet in MS Excel, and not inside the form in which i wrote the code.
Now for my 2nd problem. Assuming I have a certain number of rows(variable) when the form opens the excel sheet and I make a new entry(entire row) in the excel sheet. How do I program my form so that I can extract the cell values not knowing(i.e without hard coding) the row number that was last entered.
Thirdly, is there a way to call a VB procedure using some action(tab press or return press) in the excel sheet. I want some cell values extracted as soon as a couple of entries are entered in a row and the rest of the row entries extracted when all entries are made in the row.

I know my question was long and wierd. But hope you can help me out, give me some code as a solution.
Thanks.
jjjhhh

Embedded Excel Object In VB6 Activation
Ladies & Gents,

I'm sorry to post this because I normally keep trying until I work it out but this is killing me!!!

I'm placing an OLE Microsoft Excel Worksheet into my main form1. I want it to be active all the time so the user doesn't have to pass focus, or double click it, or anything else. I want them to be able to click the cell to be edited and hey presto.

I've read all about in place activation and seen a Microsoft KB article on how to do it in VB .Net but cant find it in VB6.

Can anyone please help me or suggest another way? I dont want to use the object method.

Thanks in advance for any help

SAJ

Tooltip And Embedded Button In Excel
Hello,
I have been looking around for a way to display a tooltip for an embedded commandbutton on an excel worksheet, and have so far had no luck, all i need a a small description of the buttons function to appear when the mouse is over the relevant button

i keep finding nice ballon tooltip stuff ... lol ... but i cant apply it in vba

Extract Embedded Excel File From EML?
Hi,

I need to write a routine to read in an EML file an extract out of it the attached XLS file. The EML file contains the email header info and then the rest of the file contains the binary XLS file.

Does anyone know how to do this?

Thanks!

Extracting Embedded Object Using VBA In Excel
Hi All,

I have some embedded text files and compressed files in my excel spread sheet. I want to save them in a seperate folder as seperate files. How to do that using vba?

I tried using Oleobject it didn't work

Thanks in advance.

Regards,
Subbu S

Accessing An Embedded Excel Sheet
Hi all,

Using VB, how do I access an Excel sheet that is embedded in a word document, so that I can can write to the cells in that sheet.

Thanks,

Stuart.

I Need Some Serious Help With OLE Container And Embedded Excel Sheet
Situation:

A form (frmTicketInfo) with a OLE container (OLETicketInfo). Container contains an embedded Excel File (TemplateTicketInfo.xls).
When a user pushes a button on the form a recordset is created with data from a database. This data is being displayed on the embedded excel file.

Problem:

It displays 5 lines (which is the default amount of records). But when I want to display more then 5 lines, it doesnt show on the embedded Excel sheet. However it has been put on the embedded file, it's just not being displayed. I tried using the refresh and update methods voor the OLE container, but that doesnt work.
I have to manually enlarge the template file using Excel. The embedded sheet shows as much rows as you have formatted in Excel.

Solution:
I dont have one... Can anyone help me?? Any suggestions on how to edit the embedded excel sheet in the OLE Container. Especially formatting the cells and updating when new data is inserted.

Resize OLE Embedded Excel Worksheet
How do I resize the newly embedded worksheet in an OLE container?
Thanks

Excel Worksheet Embedded In Word
I use the following code to create an Excel worksheet embedded in my Word
doc:
Code:Dim shp as Shape
    Set shp = ActiveDocument.Shapes.AddOLEObject(Anchor:=Selection.Range,ClassType _
    := "Excel.Sheet.8", FileName:="", LinkToFile:=False,DisplayAsIcon:=False)

Using more code, I can manipulate the contents of this worksheet.

BUT, I cannot work out how to control the size of the worksheet so that I
can see more of it. All properties that refer to height or width simply
enlarge the visible contents so that I see the same amount of the worksheet
but it's bigger.

How can I enlarge the rectangle that contains the embedded object, keeping
the contents the same size so that more of the contents are visible?

This is easy with the mouse - simply drag the borders when the object is
active but I cannot work out how to do this programmatically.

I've tried to turn on macro recording, resize the
rectangle, then turn off recording. What I have recorded is an empty Sub!!
I have tried various ways to record the actions but with no success

Please help me!!!!!!!!!!!!!



Edited by - Adagar on 4/16/2003 12:29:18 PM

Manipulating Embedded Excel Worksheets In Access
I'm having some problems populating & manipulating an Excel worksheet embedded in an Access form & wondered if anyone might be able to help.

I've got an Access form 'frmMS' with an embedded worksheet 'objDisplay' that was created by Insert >> Object >> Create New >> Microsoft Excel Worksheet

The code I've got right now is:


Private Sub butAbout_Click()

Dim objXL As Object
Dim X As Integer
Dim Y As Integer

Set objXL = Me!objDisplay.Object

For X = 1 To 60
For Y = 1 To 5
objXL.Worksheets(1).Cells(Y, X).Value = "Q"
Next
Next

Set objXL = Nothing

End Sub


I spent all day reading Office integration articles (this is my first attempt at integration) without finding anything I could use, & the above code is really just something that I hit on with trial & error after a few frustrating hours. I did see a lot about early & late binding, but everything was referring to linked sheets or opening instances of Access.

It seems to work, & lets me work with the sheet, but there are a few problems:
1) It's really, really, really slow. Exponentially slower as the X range increases.

2) Whenever I first switch the form to design view, it tells me the object is locked & any changes will be discarded. I haven't noticed anything being lost, but this scares me.

3) It seems to do all the operations, then update the sheet. I haven't seen any references to manually controlling when the embedded sheet refreshes, but it's kind of necessary for certain parts of the larger program.

4) I don't know why it works, which just bothers me.

If the larger scheme of things matters at all, the basic purpose of this is getting an embedded sheet that can handle certain graphical elements of an Access project. A simple example would be to picture the sheet like one of those scrolling displays at baseball games, where a user could hit a button & the sheet, by changing the background color of certain cells, would create a message, image, etc. I know this is a stupid way to approach it, but it's unfortunately necessary, & it just drives me nuts that I can't figure it out.

Thanks for any help you can give.

Drawing Shapes In Embedded OLE Excel Spreadsheet
For a project that I am doing, I am embedding an Excel spreadsheet into a VB form as an OLE object. In the spreadsheet I would like to draw shapes, among other things. However, whenever I attempt to draw an shape using the .Shape.AddShape() method, I receive the following error: Run-time error '1004': Application-defined or object-defined error. Here is the code that I am using:

With oleDiagram.object.ActiveSheet.Shapes.AddShape(msoShapeRectangle, 1, 1, 400, 24)
.TextFrame.Characters.Text = "Some Name"
.TextFrame.Characters.Font.Name = "Arial"
.TextFrame.Characters.Font.FontStyle = "Bold"
.TextFrame.Characters.Font.Size = 18
.Line.Visible = msoFalse
End With


I have ran this code as a macro in Excel and it runs fine, but when I attempt to use it for the spreadsheet that I have created in the form, I get the error. I can access the spreadsheet by placing text into the cells using the .Cells(1,1).Value = "something" property and can also copy a shape drawn in Excel into my applications OLE Excel sheet, however cannot draw shapes, lines, etc. Any help would be greatly appreaciated. I have been banging my head on this problem for almost a week now. Thanks!

Save The Updated Excel Fsheet Embedded In OLE
hOW DO YOU SAVE AN UPDATED EXCEL SHEET EMBEDDED IN THE OLE?
Once you save it how do you open it again??

Saving An Embedded Excel Sheet In An OLE Control
Hi,
I have an Excel Sheet that gets embedded within an OLE Control on my
VB Form.The Sheet gets displayed perfectly but i am unable to save changes
to the sheet back to the same file.
Here is the piece of code that embeds the excel sheet on the VB Form :
OLE1.Class = "Excel.Sheet.8"
OLE1.Action = OLE_CREATE_EMBED
OLE1.CreateEmbed ("C:PivotTableReportsSalesAnalysis.xls")

The embeded Worksheet contains a PivotTable
Any thoughts on this.


thanks
prabhakar

How Can I Populate Data To Embedded Excel OLE In Form??
Thank you for Your interest..
First, I used MSFlexGrid control to display data
However, My client want to copy and paste some part of the data to other Office application.
So, I thought I have to use Embedded Excel using OLE control so that I don't worrry about the copy paste feature..
But, I don't know how to populate data into the embeded Excel OLE in run time..
I tried all ways.. like following..(feel stupido... --.-- )
Please help me.. I need code snippet. Or If you have any example using this feature..I will be big help or link...

Dim sheet As Excel.Sheets
Dim worksheet As Excel.worksheet
MsgBox OLE1.Class
Set sheet = CreateObject(OLE1.Class)
worksheet = sheet(0)

Excel Chart - Paste Special As Picture In Excel Itself
Hi All,

I am working on a report and it needs to be generated daily. After generating and creating charts, I need to paste special those charts as "Pictures". Is there any way to do this? And also i need to paste special every single chart in the work book. I already done a code but it not working properly.. and the important point is i need to paste special the chart at the exact position where i intended to cut. Is this possible???

Pls treat this as emergency and advice me on this.

Thanks in advance..

Regards
Mohan

Excel 2000, Create Powerpoint Org Chart From Excel.
I want to create a powerpoint org chart from Excel using information held in Excel. I have found how to add an Org chart into Powerpoint but can't find anywhere that tells you how to change the details/options or add Subordinates Managers etc and alter those details.

Anyone have any ideas (I don't want to create seperate text boxes if possible.)

Ps if you can create a good powerpoint org chart from excel, any ideas on the best layout of information in the spreadsheet to work through and create it.

This is one of those, that would be good if you can do it (created them in the past and are time consuming pains), rather than has to be done last week ideas.

Regards.

rob.

Copy&&Paste From Excel To An Embedded Word Doc Page 2
Im Having 2 problems.
1) How do u open the existing document without wiping out previous changes(like the bookmarks I added). The following code seems to create a new word doc instead of using the existing document embedded.

2) How would I Paste spreadsheet range onto Page2? Bookmarks?

The following code is what I have come up with so far:

Excel.ActiveWorkbook.Worksheets(1).Shapes("OBJECT 1").Select
Selection.Verb Verb:=xlPrimary
Excel.Range("Range").Copy
Word.Documents(1).Select
Word.ActiveDocument.Bookmarks(1).Select
Word.Selection.PasteSpecial

Excel.ActiveWorkbook.Worksheets(1).Shapes(1).OLEFormat.Activate
instead of the first two lines of code

Make A Copy Of Excel Sheet Without Embedded Code
Hi guys,

I want to make a copy of an Excel worksheet, but I'd like to leave out the code that's embedded in it. To make a copy of the sheet, I simply use the code below:


Code:
Sheet1.Copy
...this creates a new workbook out of that sheet, so all I have to do is then save this workbook as a new file. However, all the code that was embedded in the original sheet is copied into the new workbook as well. Is there any way to prevent this?

Thanks!

Hiding Excel When Processing Spreadsheet Embedded In Word
I’ve written a program which converts Excel spreadsheets embedded in Word into Word tables. I don’t want either Word or Excel to be visible. Hiding Word is straightforward:

Set wdApp = New Word.Application
wdApp.Visible = False

but I can’t figure out how to totally hide Excel. I’m opening the embedded object with the following code, which does hide Excel but only after it has appeared on screen for a split second:

Code:For Each myInlineShape In wdApp.ActiveDocument.InlineShapes
 If InStr(1, LCase(myInlineShape.OLEFormat.ProgId), "excel.sheet") > 0 Then
   myInlineShape.Select
   myInlineShape.OLEFormat.Open
   Set myExcelSheet = myInlineShape.OLEFormat.object
   myExcelSheet.Application.Visible = False


myInlineShape.OLEFormat.DoVerb (wdOLEVerbHide) has no effect.
I thought of maybe opening Excel in the same way as Word and then somehow assigning myInlineShape.OLEFormat.object as the active workbook but I can't figure out how.
 
 

Saving An Embedded Excel Object From Access OleObject To A File
The following code fragment is my attempt to extract embedded documents from an Access database and save them as seperate files.
I am working in Access 2002, where the code works but it doesn't work in Access 2003 where I get an Excel 1004 Error. Ultimately, I want the file in Access 2000 format so it can be used by 2000-2003 users. When it breaks into Debug mode and I step through line by line it works fine.
Does anyone have any ideas? I've tried several ways of calling the Save As and keep getting the same error?
Open to better ideas, I need to repeat this process for Word and Powerpoint documents as well.
Also does anyone know why Access 2002 - 2003 doesn't let you embed Word documents into a table?

Code:
Private Sub Command0_Click()
'On Error GoTo err_Section

Dim objOLE As Object
Dim rs As Recordset
Dim strSQL As String
Dim strAppName As String
Dim strFilename As String
Dim wkb As Excel.Workbook

strSQL = "SELECT FileObject FROM tblFileObjects"
Set rs = CurrentDb.OpenRecordset(strSQL)
Do While rs.EOF = False
'Identify file type
Me.OLEBound = rs!FileObject
Set objOLE = Me.OLEBound.Object
strAppName = objOLE.Application
MsgBox objOLE.Application
'Filename assigned
strFilename = GetFileName()
If strAppName = "Microsoft Excel" Then
Do While Dir(strFilename & ".xls") <> ""
strFilename = strFilename & "1"
Loop
strFilename = strFilename & ".xls"
Me.OLEBound.Action = acOLEActivate
Set wkb = Me.OLEBound.Object.Application.Workbooks(1)
'wkb.SaveAs strFilename
'Tried this line too - same result
Forms![frmOleform].OLEBound.Object.Application.Workbooks(1).SaveAs "strFilename"
Set wkb = Nothing
Exit Do
End If
'If strAppName = "Powerpoint Presentation" Then
'Similar process for Powerpoint
'If strAppName = "Word Document" Then
'Similar process for Word.
Loop
End Sub

Populating An Excel Worksheet Embedded In An Access Report With Data
IS IT POSSIBLE TO MANIPULATE DATA INSIDE AN EXCEL WORKSHEET THAT IS EMBEDDED IN AN ACCESS REPORT??? I'm beginning to think not. I've been trying for 2 days with no success.

I inserted worksheets in various ways, but let's say I insert a worksheet by doing the following:

In report design mode --> Insert --> Object... --> Create New --> Microsoft Excel Worksheet.

Now, I have a query. I want to populate the embedded, or linked, excel worksheet with the results of my query.

Access cannot create diagonal column headers which my client REQUIRES, and the "Rotate Text" ActiveX control is not clean enough. So, I am using an Excel worksheet for the formatting only. I would import data into the Excel Worksheet from Excel rather than Access, but unfortunately, since my query is a complex crosstab query with a parameter, I get errors when I try to write the SQL statement in Excel. Therefore, I need to embed the worksheet in my Access Report and populate it with data programatically. So far, all my attempts have failed.

At this point I've removed all the unnecessary complexity and all I have is this:

1 Table with two columns (id, name)
1 Query getting names from the table
1 Report with an embedded Microsoft Excel Worksheet

Can somebody please tell me how to get the names into the worksheet in the report?

Macro W/ Embedded Excel Sheet: Error Script Out Of Range
Due to my worksheet's columns being aligned to where I don't have enough space to code in some new information I had to do the following:
MS Word: InsertObjectMS Excel WorksheetCopy it over to Excel and use Past SpecialExcel Worksheet Object
Next, after inputting the =sumif formulas, I created a Forms Button to have it execute the vb script. What needs to happen is for the formulas in the embedded excel sheet to update I have to open & close the embedded sheet. What I want is for the button to run that procedure automatically. When I execute that script it gives me the error "subscript out of range". The script is the following and in debug mode it highlights the 2nd row:

ActiveSheet.Shapes("Object 14").Select
Windows("Worksheet in Service Count Sheet").Visible = True
Selection.Verb Verb:=xlPrimary
ActiveWindow.Close

What can I do to resolve this? I have included a copy of the test sheet.

Thanks.
Troy

Populating An Excel Worksheet Embedded In An Access Report With Data
IS IT POSSIBLE TO MANIPULATE DATA INSIDE AN EXCEL WORKSHEET THAT IS EMBEDDED IN AN ACCESS REPORT??? I'm beginning to think not. I've been trying for 2 days with no success.

I inserted worksheets in various ways, but let's say I insert a worksheet by doing the following:

     In report design mode --> Insert --> Object... --> Create New --> Microsoft Excel Worksheet.

Now, I have a query. I want to populate the embedded, or linked, excel worksheet with the results of my query.

Access cannot create diagonal column headers which my client REQUIRES, and the "Rotate Text" ActiveX control is not clean enough. So, I am using an Excel worksheet for the formatting only. I would import data into the Excel Worksheet from Excel rather than Access, but unfortunately, since my query is a complex crosstab query with a parameter, I get errors when I try to write the SQL statement in Excel. Therefore, I need to embed the worksheet in my Access Report and populate it with data programatically. So far, all my attempts have failed.

At this point I've removed all the unnecessary complexity and all I have is this:

1 Table with two columns (id, name)
1 Query getting names from the table
1 Report with an embedded Microsoft Excel Worksheet

Can somebody please tell me how to get the names into the worksheet in the report?

How To Find The Visible Columns Of An Embedded Excel Sheet In A Word Doc
Hi
I have an excel object embedded in a word document with 10 colums in it, but only five columns are visible from the word document.

How can I find out the visible columns number of my embedded object.

Please sugget.

Regards

Kesav

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