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




Resize OLE Embedded Excel Worksheet


How do I resize the newly embedded worksheet in an OLE container?
Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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

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?

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?

Resize Excel Worksheet In OLE
Hi, all:
I am a newcomer and currently I am wrestling with OLE control in VB. I inserted an Excel file into the OLE control. This is an application for kids. As I don't want to bother them with the menus of Excel, so I set OLE's enabled property to false. But there is a serious problem then. The size of the active worksheet always remain the same as in the initial file. If I want to add more data to the cells or insert a chart, it only display the part within the initial rectangle range and other parts can't be seen. How to resize it without user's double clicking? I know one way is to set the width or height, but
the method OLE1.object.Application.width=... failed.
Anybody has done this before? Thanks very much

Resize Excel Worksheet In OLE Control
Hi, all:
I am a newcomer and currently I am wrestling with OLE control in VB. I inserted an Excel file into the OLE control. This is an application for kids. As I don't want to bother them with the menus of Excel, so I set OLE's enabled property to false. But there is a serious problem then. The size of the active worksheet always remain the same as in the initial file. If I want to add more data to the cells or insert a chart, it only display the part within the initial rectangle range and other parts can't be seen. How to resize it without user's double clicking? I know one way is to set the width or height, but
the method OLE1.object.Application.width=... failed.
Anybody has done this before? Thanks very much

Resize Excel Worksheet In OLE Control
Hi, all:
I am a newcomer and currently I am wrestling with OLE control in VB. I inserted an Excel file into the OLE control. This is an application for kids. As I don't want to bother them with the menus of Excel, so I set OLE's enabled property to false. But there is a serious problem then. The size of the active worksheet always remain the same as in the initial file. If I want to add more data to the cells or insert a chart, it only display the part within the initial rectangle range and other parts can't be seen. How to resize it without user's double clicking? I know one way is to set the width or height, but
the method OLE1.object.Application.width=... failed.
Anybody has done this before? Thanks very much

ListBox Embedded In Worksheet
Hi,

I'm trying to populate a listbox with words which are contained in a named range, but the idea is that the listbox contents change depending on which named range is typed into cell A1. The listbox is not on a form it is simply embedded in the worksheet.

The idea is that users type a word into cell A1 and the listbox is positioned in cell B1 down to about B10. Whatever word they type in cell A1 they are presented with a list of alternative words in the listbox (kind of like a thesaurus or dictionary idea except very limited in what they are likely to search for).

I have lots of named ranges which contain the alternative words so for example cell AB1 contains the word 'migraine' which is the name of the range then the cells below it contain alternative words e.g 'headache'.

So if a user types 'migraine' into cell A1 I want the list box to display 'headache' which is contained in the named range.

How do I tell the listbox to consider the term typed into cell A1 as a named range and thus display the contents of the range in the listbox?

I imagine I would need to have a formula in the input range of the list box but this doesn't seem possible.

I'm not even sure if my listbox is called 'ListBox1' because it is just embedded in the worksheet and not on a form.

Any help is very much appreciated!

Resizing Embedded Worksheet
We're having a serious issue that is threatening our rollout date. We have an Excel worksheet embedded in a PowerPoint slide and need to resize it programatically....not the PP Shape, but the actual Worksheet.
Try this, run Excel and select a range of cells. Now run PowerPoint beside Excel and bring up a slide. Grab the outline of the selected cells and drag them onto the slide. You now have an Excel worksheet embedded in your PP slide. Let's say you can see 4 columns. If you click on the slide (not on the worksheet) the worksheet just displays as a grid. If you single-click the grid and grab a resize handle and resize the thing, the columns grow proportionally and you still see only 4. If you double-click the worksheet (thus activating Excel) and grab a resize handle and resize the thing, you see more (or less) columns and they don't zoom. We need to replicate the latter behavior in code but all we've been able to accomplish is the former, the proportional growth thing.
In our app, we have references to the slide, the shape and the excel worksheet. We can programmatically activate the worksheet, but all efforts to resize it just resize the slide and expand the columns.
HELP!! Please! Anyone!!! HELP!!!

Printing Embedded Ole Worksheet
I got an embedded ole worksheet in an access database and am looking for a way of printing it without opening the form.
So far I can get it to print as follows but there must be a better way


Private Sub Image_DblClick(Cancel As Integer)
Dim appexcel As Excel.Application
Dim wbExcel As Excel.Workbook
Dim shexcel As Excel.Worksheet
Set appexcel = New Excel.Application
Set wbExcel = appexcel.Workbooks.Add
Me.Image.SetFocus
DoCmd.RunCommand acCmdCopy
appexcel.Visible = True
appexcel.Range("A1").Select
appexcel.ActiveSheet.Paste
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
appexcel.ActiveWorkbook.Close
End Sub

Many thanks
John

Worksheet Embedded Objects Don't Work
All of a sudden one day Command Buttons embedded on a worksheet quit functioning. I also noticed that if I try to insert any embedded object be it command button, text box or whatever in a current workbook or brand new workbook I get the error Cannot Insert Object. I've searched Help, looked at all the various menu protection items, searched various Excel forums and I can't find an answer. Any assistance will be greatly appreciated as this is driving me nuts.

Massive Slowdown With Embedded Worksheet In Powerpoint
Here's what i'm trying to do:
In excel I created a worksheet, a chart, and wrote VBA to carry out a simulation. The results of the simulation changes values on the worksheet and the chart updates. I am now trying to add this project into PPT to demonstrate the simulation.
In doing so, I have tried to embed the workbook into powerpoint and I have tried to link the workbook into powerpoint.
Long story short is that I have some new code written that carries out the simulation and it runs quite fast. As soon as I UPDATE the slide which shows my chart from the embeded workbook, my simulation now runs painfully slow.
If I close the slideshow and reopen it, the first time I run the simulation it goes fast, all other times it goes really slow. The slowdown seems to be when reading and writing to the worksheet. However, the use of "excel.application.screenupdating = false" makes no difference.
Does anyone have any idea what is going on or how to keep my simulation running fast?

Open/Edit Embedded Worksheet In WORD
I have been trying desperately to get a macro in word (and thus hopefully my VB app.) to simply find the embedded Excel sheet within a word document.
That was the easy part, the thing I am now believing may in fact be impossible, is getting it to then open the embedded worksheet (in MS Word) and 'Select-All' then 'Paste' it into an existing worksheet wihthin Excel.
By recording a new Macro, I try and do this (having it track the changes I make and thus writing a script for me), but ONLY when the macro is recording, the program will NOT allow me to either double-click the spreadsheet OR right click it (so I could then choose 'Edit' or 'Open').
I hope this function is not completely impossible, either through Word or VB, so If any of you experts out there know anyhting about this, your help would be GREATLY appreciated! thanks...

Update Shown Cells In Embedded Worksheet In Word
I have a Word document with an embedded Excel worksheet. I have certain macros in the worksheet (run by the user) that insert or delete rows. When this happens the embedded object is not automatically updated with the cells that should be shown. I know this can be done by dragging the borders of the object, but is there any way to do this programmatically? I've been at this most of the day. I can't find any propery or method of InlineShape that will do this.

The best I've come up with is to select the new correct cell range in the embedded worksheet, and paste it in Word as a new embedded worksheet, and then delete the old one. When you paste, the "selection size" is automatically correct. This isn't an ideal solution. For one thing the Excel document closes, since it's deleted, and the user has to right click|[Worksheet object]|[Open] again (on the new object).

Here's what I do now:

Code:
Dim xlwb As Excel.Workbook
Dim oCurrentList As Object

Set oCurrentList = ActiveDocument.InlineShapes(1)
oCurrentList.Activate
Set xlwb = oCurrentList.OLEFormat.Object
xlwb.Activate

xlwb.Sheets(1).Range("Plist").Copy
Selection.PasteSpecial Placement:=wdInLine, DataType:=wdPasteOLEObject
oCurrentList.Delete
By the way, I'd also like to know how to do this programmatically, right click|[Worksheet object]|[Open] -- so that the worksheet opens as a new window in Excel. [InlineShapes(x).OLEFormat.Open] doesn't do this. Seems [.OLEFormat.Open] and [.OLEFormat.Activate] and [.Activate] do the same thing...

Thank you for any help,
nick

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 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

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

 

Find A Particular Comment In An Excel Worksheet Using Excel VBA
If I can select all the comments in a worksheet using VBA: -

    Set rg = Selection.SpecialCells(xlCellTypeComments)

why can't I cycle through all the selected cells to find out their individual values?

I want to home in on a particular cell (containing a comment) to do some processing. The above line manages to select all the comment-containing cells. But I cant seem to "find" the cell I want.

Remember we have to do it using VB Editor in Excel.

Thanks for going through the problem

Ali

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.

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??

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

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)

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

Copy&amp;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!

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