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
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
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 An Worksheet Object In Word Document
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.
Separate Data In Worksheet Cells Then Add To New Worksheet
I have a spreadsheet with 9 columns and a variable number of rows. Each of the cells contains multiple values which include a date, time and location. I want to populate a second spreadsheet the the data from each of these cells. I have attached an example workbook which has the original data in SheetA, and the results I am trying to achieve in SheetB. The spreadsheed will be easier to understand than my explanation I think.
The data in the cells needs to be separated into individual cells in the new sheet, for each set of cell data, the associated data in columns 1 and 9 need to be added/repeated.
Is this possible?if yes, how do I achieve this?
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
To Determine The Rows To Paste A Worksheet(blank Cells To Paste Next Worksheet)
hi all experts out there....
would llike u guys to help out with a problem i am facing....
the code below is to select each of the worksheet,copy it and paste it in worksheet (printer").....i got 3 worksheets to paste into worksheet ("printer")....worksheet("11 aug"),("12 aug") and ("18 aug")....i got no problem pasting the first two worksheets("11 aug") and ("12 aug")...but i got a problem pasting the last worksheet("18 aug").....i want to paste each worksheet with a offset of (3,0) but the last worksheet paste at another cell instead......i attach the excel doc name (total)(workbook) and the macro.....the ("sub regroup")....need to be improve..pls help ......thank a lot..."P
Code:
Sub regroup()
'
' regroup Macro
' Macro recorded 9/3/2003 by SGTANCKE
'
'
Sheets("11 Aug").Select
Rows("1:" & Sheet1.UsedRange.Rows.Count).Select
Selection.Copy
Sheets("Printer").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("12 AUG").Select
Rows("1:" & Sheet2.UsedRange.Rows.Count).Select
Selection.Copy
Worksheets("Printer").Activate
ActiveCell.Offset(rowOffset:=3 + Sheets("Printer").UsedRange.Rows.Count, columnOffset:=0).Activate
ActiveSheet.Paste
Sheets("18 AUG").Select
Rows("1:" & Sheet3.UsedRange.Rows.Count).Select
Selection.Copy
Worksheets("Printer").Activate
ActiveCell.Offset(rowOffset:=3 + Sheets("Printer").UsedRange.Rows.Count, columnOffset:=0).Activate
ActiveSheet.Paste
Columns("E:E").EntireColumn.AutoFit
End Sub
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.
Word Automation: Word Window Is Not Shown While Opening From VB (Win2000Server-Office2000)
Hi All,
I am getting problem in word automation with Visual Basic 6.0 and ASP
See, what i have done in my project:
- I have one ASP application
- from this i am calling one VB DLL
- In my VB DLL i am using word automation in which i am opening word for some process.
- all the process what i want to do is done perfectly and my file is also getting stored on particular location
- the process will call that dll first, that dll will call object of word library then it will show word then will do my process, then will save file.
Problem:
i have win XP and office 2003 installed on my machine. my app is running well on my machine without problem.
I have win 2000 server and office 2000 installed on my production machine. Over here my app is running and functionality is going well enough but the only problem is that i cannot get the word window opened on that machine while my functionality is executing.
Can anyone please help me?
-Prerak
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?
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?
Protect Some Cells Of A Worksheet
hello to all,
How do you protect some part of a worksheet, not the entire sheet , like "activesheet.protect" in Excel? any idea??
thanks,
TK
VB6 And EXcel Worksheet Cells
I am writng a VB6 appliication and I would like to be able to move some data I have in an array to some cells in a MS Excel workseet. I am tryying to use the OLE component but I can;t figure out how to move my data to the cells in the Excel sheet.
Can anyone give me some ideas or pointers on how to get my data into the cells in a MS Excel worksheet?
In Word, Check # Of Cells In Current Row, Then Select First Two Cells In Row
I'm trying to do a little VBA subroutine that will run in Word 2003 (VB 6.5), when insertion point is in a table.
What I want it to do is:
* Confirm the insertion point is in a table
* Go to the first row in current table
* Check if the number of cells in that row >= 5
* If so, merge the first two cells in that row
* If not, go to the next row
* Continue checking (and merging, if appropriate) to end of the table
I know how to check if insertion pt in in a table and how to merge two cells once they're selected, but am totally stumped on the middle part -- the real heart of the matter... (I've tried a bunch of things, using VBA Help info as a guide, but to no avail.)
* How do I determine the number of cells in the current row?
* How do I select the first two cells in current row?
Really would appreciate any help/guidance.
Edited by - topaz2 on 1/20/2007 8:44:46 PM
Position A Range Of Cells On Worksheet?
I am using a combobox control to select which report I want to jump to which is displayed on one worksheet. I use the Range command to select the range of cells where the report resides. How can I position that range of cells to display at the top of the worksheet? Also, the range command Highlights the range of cells. How can I un-highlight the range selection after it is selected or is there a better command I could use to jump to a cell name and position it at the top of the worksheet? Thanks.
Selection Of Certain Cells And Pasting It To A Different Worksheet
Is there a way for me to select certain cells to be copied onto another spreadsheet? I attached an image of a small sample of the spreadsheet I'm working on (the real one is more than 5000 line items long). My problem is that there are two rows for each item (the part number and the location). I need to copy the part number, the description of that part #, the contract #, the model code and the unit cost. I need to be able to copy those particular cells for each item and then paste it onto another spreadsheet and the tricky part is to keep all the cells for the same item on the same row.
Can someone help me with this?
Parse Some Cells From A Worksheet, Send To 2nd
I'm trying to extract info from one excel worksheet, and send it to certain fields in a 2nd worksheet.
The cells where the info is located in the source worksheet varies, but there will be predictible constant strings to the left of the info (sometimes the constant string can further be identified by text in a cell below it, to distinguish it from a similar string that happens to be similar).
So, I want to say:
Go to the source worksheet
Find (certain string, ie: "glu", but not "glumeter")
Go to cell one column over
Extract the integer there
Go to the destination worksheet
Place the integer next to "glu" in A5
Complicating it also, is that:
1. Some of the info I want has the characteristic of containing certain strings (ie: "PO", "SQ", "IV")
2. Sometimes there will be a duplicate string, but it they will have an identifying column to their left with different integers. I'll want to choose the one that has the higher (or perhaps lower) integer.
3. Some extra string may be in one of the lines I'm trying to choose between (ie: "(RVS ORD# 60)")
4. The column or row the info is in will vary (which is why I want to find the certain string that "tags" the info location).
---
Example of the source sheet:
A B C D E
1 Name Julie MR# 1236
2 36 Glumeter
3 66 ISOSORBIDE DINITRATE 10. MG PO ONCE ONCE
4 65 QUINAPRIL 5. MG PO ONCE ONCE
5 22 unneeded info
6 68 (RVS ORD# 60 ) QUINAPRIL 5. MG PO 2X/D EACH DAY
7 Glu 143
8 (67-109)
9 BUN 17
10 (6-24)
---------------
So in this example, I would want to take the info:
"Julie"
"1226"
"ISOSORBIDE DINITRATE 10. MG PO ONCE ONCE"
"QUINAPRIL 5. MG PO ONCE ONCE"
"143"
"17"
Easy, huh?!
Thanks for any help.
Selected Cells In Excel Worksheet
I have a form which has an OLE container which contains an Excel worksheet. When the user selects a group of cells in the worksheet, I need to be able to access the selected cells. Does anyone know if there is a property that will allow me to access this information?
Thanks.
north
Copy Cells From One Worksheet To Another If A Specified Value Is Present
Hi everyone.
I'm new to VBA so I apologise if there is a very simple answer to this query. I have an Excel worksheet that contains a large amount of data and have been tasked to break the data down into certain workpackages. I have inserted a column where the workpackage number can be entered, but I now need to find a way to move the workpackages to different worksheets, i.e. All data numbered 1 to Sheet 2, data numbered 2 to Sheet 3 etc.
I hope this makes sense and I'd be grateful for any ideas anyone may have.
regards
David
Edited by - MOD-David on 4/27/2004 2:28:01 AM
Word In Ole, Shown In A FORM
Hello,
i've build a table with an ole object that contain word document.
then i've build a form to show it.
i whis i had some scroll bar to navigate in word doc... there's any way of having them?
thenks!
Inserting Picture In Worksheet That Has Protected Cells
Have a question here. Is it possible to be able to insert a graphic (picture) into a worksheet that has some protected cells? If the worksheet is unprotected, there is no problem. I thought Excel 2003 had the capability to do this.
Any information would be great!
Finding Target Cells, Then Copying To New Worksheet.
Hi,
Please see image attachement.
What i need is code that looks down column B and gathers data from columns J and H for each individual job. Then copys that data to a new sheet. (As i want to do some calculations after...)
For example, for each occurence of Ambient, i want the code from columns J and H to be copied out.
Heres my code so far.. which is quite a way off...
Code:
Private Sub CommandButton1_Click()
Dim r As Range
Dim i As Range
Dim Po1 As Range
Dim w As Worksheet
Set w = Worksheets(1)
Set r = w.Range("A1", w.Range("A65536").End(xlUp))
Range("A16:S29").ClearContents
Set Po1 = Worksheets(2).Range("po1")
For Each i In r
Application.StatusBar = r
If i = Po1 Then
Range("???") = i.Range("H1")
Range("a????") = i.Range("J1")
End If
Next i
Application.StatusBar = False
End Sub
Thankyou for your help in advance
Compare, Copy Non Contiguous Cells To New Worksheet
Hello,
I'm a VBA newbie who desperately needs help with a macro that should copy non-contiguous cells when matching values belonging to two columns from two different worksheets, to a third worksheet.
The problem is that I get a runtime error = 1004 on the copy execution (after the Else.) I believe it's a referencing problem.
The macro is:
Sub Macro1()
For x = 1 To Sheets("Campaign").Range("B2").End(xlDown).Row
For y = 1 To Sheets("Loaninfo").Range("I9").End(xlDown).Row
If Sheets("Campaign").Cells(x, 2) <> Sheets("Loaninfo").Cells(y, 9) Then
found = False
Else
Sheets("Loaninfo").Range(Cells(y, 1), Cells(y, 9)).Copy _
Sheets("PAE_Offerlist").Range("A3").End(xlUp).Offset(1)
End If
Next y
Next x
End Sub
Thanks in advance.
Sonny
Creating A String In VBA From Cells In Excel Worksheet
Hi Guys,
I have a range of cells in Excel that I want to string together in VBA so that i can that string in part of a SQL Query. I really have no idea where to start. I am guessing a LOOP statement, but have no had any experience with these previously.
I have attached the file that i can use as an example.
i would like the output to be something like;
'this','is','a','testing','range','of','cells'
Thanks for any help in advance.
Daniel
Copying Cells From One Worksheet To Another In Transposed Manner
Hi everyone,
I am working on creating a VB 6.0 application which has excel as backend. Basically I have 3 sheets
1. A location sheet from where I need to pick values from particular range of cells ( say C2: F20). I have different excel sheets for a different locations and I need to pick values from same range of cells.
2. Next I have A detail Summary sheet. This Summary sheet is initially empty. But basicaly I want the values from these cells in range in sheet 1 to be transposed and if possible linked to the detail summary sheet.
for eg. My sheet 1 cells look like
Config1 Config2 Config3
Cost A
Cost B
Cost C
So now I want this range array to be dispayed like
Cost A Cost B Cost C
Config 1
Config2
COnfig3
I did the same thing in excel(but without using VB ) by using Transpose Function in Excel
But now I want to create Transpose formula in the excel sheet no.2 where If I update the data in sheet 1 its automatically automated reflected in sheet 2. So basically I want to set up transpose formula in excel workbook using VB code. Is it possible. Also there is one more thing I wish to do. I have 10 worksheets corresponding to each location. I want to Pick up same range of cells from all the locations and want to display them on sheet2
somthing like
Cost A Cost B Cost C
Loc1 Config 1
Loc1 Config2
Loc1 COnfig3
Cost A Cost B Cost C
Loc2 Config 1
Loc2 Config2
Loc2 COnfig3
Please help me doing this. Its very important for me.
Copying Cells From One Excel Worksheet To Another In Transpose Manner Using VB 6.0
Hi everyone,
I am working on creating a VB 6.0 application which has excel as backend. Basically I have 3 sheets
1. A location sheet from where I need to pick values from particular range of cells ( say C2: F20). I have different excel sheets for a different locations and I need to pick values from same range of cells.
2. Next I have A detail Summary sheet. This Summary sheet is initially empty. But basicaly I want the values from these cells in range in sheet 1 to be transposed and if possible linked to the detail summary sheet.
for eg. My sheet 1 cells look like
Config1 Config2 Config3
Cost A
Cost B
Cost C
So now I want this range array to be dispayed like
Cost A Cost B Cost C
Config 1
Config2
COnfig3
I did the same thing in excel(but without using VB ) by using Transpose Function in Excel
But now I want to create Transpose formula in the excel sheet no.2 where If I update the data in sheet 1 its automatically automated reflected in sheet 2. So basically I want to set up transpose formula in excel workbook using VB code. Is it possible. Also there is one more thing I wish to do. I have 10 worksheets corresponding to each location. I want to Pick up same range of cells from all the locations and want to display them on sheet2
somthing like
Cost A Cost B Cost C
Loc1 Config 1
Loc1 Config2
Loc1 COnfig3
Cost A Cost B Cost C
Loc2 Config 1
Loc2 Config2
Loc2 COnfig3
Please help me doing this. Its very important for me.
Need Help Keeping A Form Visible And Selecting Cells On A Worksheet
I am working on a project where I need to be able to set some label controlsources in a form by clicking on the respective cell in a worksheet. I can get the first one to work fine by selecting the cell I want to reference then activating the form. Then using:
Private Sub Sp1_Click()
Sp1.ControlSource = ActiveCell.Address
End Sub
But then I can’t click back on the sheet and select another cell for the other labels, without closing or hiding the form. The form has to remain visible; I am looking for a way to be able to select other cells on the sheet. I would appreciate any help or ideas that any one can offer.
Edited by - CTrader on 8/10/2005 5:55:50 AM
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.
How To Auto Update A Worksheet?
Is there any way for me to run a macro automatically say every 5 minutes (some sort of loop)? I have one computer my users enter data, and another that displays it. Currently the user has to manually run a macro on the display computer to update from the other workbook. Any ideas?
Thanks, Adam.
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.
Embedded Word Documents And Word !?
I need to open an embedded word document (embedded in an access table) from vba access code , for editing in a word window ? can anyone help me with this ?
Add/update A Hyperlink To An Excel Worksheet
hello,
Is there anyone who can help me with code or point me in the right direction.
I want to add/update a hyperlink in an excel worksheet from my VB6 application. The file path I want it to follow currently resides in a text box (text1.text), when I click the update command button I want it to add/update the hyperlink. I have been trying to get this code to work......
Private Sub Command1_Click() ' update
........
xlSheet.Range("A1").Select
Selection.Hyperlinks.Add anchor:=Selection, Address:=Text1.Text
end sub
But clearly it is wrong, any suggestion would be appreciated.
How To Update A Csv File To An Excel Worksheet
I have an Excel worksheet shows sales progress by product category/days. Each day, our system spit out a sales report summarized by product category. How can I update this information to the Excel worksheet that has the column represent the day of sales reported and the rows are the products. For example, sales for 1st day of the month on colunm A, 2nd on column B and so on. Row 1 will be static for the headings, row 2 is for Widget A , row 3 for Widget B & so on.. You advise will be greatly appreciated.
Cells Can Not Update
I can't get cells I128 and I133 to update automatically when numbers are entered in cells D126 adn D128. Thanks for any help. The code in VB:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$128" Then
If ((Target.Address) = "D128") And ((Target.Address) = "D126") Then
Range("I128").Value = "N/A"
Range("I133").Value = "N/A"
End If
If Range("D126") <= 10 And ((Target.Value) > 0) And ((Target.Value)<=10) Then
Range("I128").Value = 1#
Range("I133").Value = -1.1
Else
Range("I128").Value = "N/A"
Range("I133").Value = "N/A"
End If
If Range("D126") <= 10 And ((Target.Value) > 10) And ((Target.Value) <= 500) Then
Range("I128").Value = 1.1766 - 0.1766 * Log(Range("D128").Value)
Range("I133").Value = -1.2766 - 0.1766 * Log(Range("D128").Value)
Else
Range("I128").Value = "N/A"
Range("I133").Value = "N/A"
End If
End If
End Sub
Using Vb6 To Update Worksheet, Cannot Change Orientation To Landscape
I ran a macro to first get the syntax for changing orientation to landscape.
I then copied the code as below:
If I use original code:
With oexcel.activesheet.pagesetup
.orientation=xlLandscape
end with
It immediately exits the Do loop.
If I change the code:
oexcel.activesheet.pagesetup.orientation=xlLandscape
end with
I do not exit the do loop, but the page orientation does not change to landscape -- it remains in portrait.
Any help will be appreciated.
Thanks
Update Cells In Excel From VB
I have a lots of excel-files (about 500) and in each of them I need to
update some cells, for example the figure in cell D5 should increase with 1,5 %. All files have different filename, but the are all saved in same catalog.
Is it possible to open a excel-file without using the filename ?.
Have someone any idea how I can make a application to upgrade all my excel-files ?
Update Cells From Form
I have the following code which enables me to search a worksheet by first name and/or last name and display results in textboxes on a form. This works fine, but can anyone help me with the final part. When the persons details are displayed on my form, when I click the close button, if any of the textboxes have been changed then I want the appropriate cells in the worksheet to be updated. The code I have to search is below:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
FLname = False
Dim Myname As String
With frmData
'''''' Find the whole Name '''
If ucase(.txtFname) <> "" And ucase(.txtLname) <> "" Then
Myname = ucase(.txtFname) & " " & ucase(.txtLname)
Set fnd = ws.Range("B:B").Find(What:=ucase(.txtLname), LookIn:=xlValues)
If Not fnd Is Nothing Then
MyRow = fnd.Row '' set row nr to first occurence of the find
If ucase(Cells(fnd.Row, 1).Text) <> ucase(.txtFname) Then
Do
fnd.Value = ucase(.txtLname)
Set fnd = ws.Range("B:B").FindNext(fnd)
If ucase(Cells(fnd.Row, 1).Text) = ucase(.txtFname) Then
.txtFname.Text = Cells(fnd.Row, 1).Text
.txtLname.Text = Cells(fnd.Row, 2).Text
.txtDOB.Text = Cells(fnd.Row, 3).Text
.txtHousenr.Text = Cells(fnd.Row, 4).Text
.txtStreet.Text = Cells(fnd.Row, 5).Text
.txtPostcode.Text = Cells(fnd.Row, 6).Text
.txtPhone.Text = Cells(fnd.Row, 7).Text
FLname = True
MyRow = fnd.Row
End If
Loop While Not fnd Is Nothing And fnd.Row <> MyRow
End If
If ucase(Cells(fnd.Row, 1).Text) = ucase(.txtFname) Then
.txtFname.Text = Cells(fnd.Row, 1).Text
.txtLname.Text = Cells(fnd.Row, 2).Text
.txtDOB.Text = Cells(fnd.Row, 3).Text
.txtHousenr.Text = Cells(fnd.Row, 4).Text
.txtStreet.Text = Cells(fnd.Row, 5).Text
.txtPostcode.Text = Cells(fnd.Row, 6).Text
.txtPhone.Text = Cells(fnd.Row, 7).Text
FLname = True
End If
Else:
If fnd Is Nothing Then
MsgBox "Sorry could not find " & Myname & " Please check spelling and re-enter"
Exit Sub
End If
End If
End If
'''''''''''''' This looks for the first or last name '''''
If ucase(.txtFname) <> "" And ucase(.txtLname) = "" Then '' see if Fname has a name
Myname = ucase(.txtFname)
Set fnd = ws.Range("A:A").Find(What:=ucase(.txtFname), LookIn:=xlValues)
Fname = True
ElseIf ucase(.txtLname) <> "" And ucase(.txtFname) = "" Then
Myname = ucase(.txtLname)
Set fnd = ws.Range("B:B").Find(What:=ucase(.txtLname), LookIn:=xlValues)
Lname = True
End If
If Fname = True Or Lname = True Then '' this alow code to run here if searching for Fname or Lname
If Not fnd Is Nothing Then
.txtFname.Text = Cells(fnd.Row, 1).Text
.txtLname.Text = Cells(fnd.Row, 2).Text
.txtDOB.Text = Cells(fnd.Row, 3).Text
.txtHousenr.Text = Cells(fnd.Row, 4).Text
.txtStreet.Text = Cells(fnd.Row, 5).Text
.txtPostcode.Text = Cells(fnd.Row, 6).Text
.txtPhone.Text = Cells(fnd.Row, 7).Text
MyRow = fnd.Row '' set row nr to first occurence of the find
FLname = False
End If
If fnd Is Nothing Then
MsgBox "Sorry could not find " & Myname & " Please check spelling and re-enter"
Exit Sub
End If
End If
End With
End Sub
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!
-------------------------------------------
Embedded Word Document Can't Tab
In my VB App I embed a Microsoft Word form template (VbOLEPrimary), and then prefill some of the bookmarks with data from an SQL database. I then protect the document with wdAllowOnlyFormFields so that the user can only enter data into the remaining form fields. My problem is that the user cannot use the Tab key or the Backspace key. The forward Delete key works. Any ideas?
Also, when double clicking on the embedded Word Document the File Menu dropdown is absent and my users need to email their document easily. Is there an easy way to display the File menu or add the Email item?
Get Attachment Embedded In Word Doc
Hi,
I try to get the attachment that is embedded in the MS Word document using Visual Basic 6.0. I have searched on google but did not find any info. Please help.
Thanks,
- Nikki -
Embedded Word Documents
I am trying to create a application that allows me to click on a command button which lets me read an OLE object from an Access database. I then want to be able to store the document onto the form, edit the document using Word (97) and write the document back into the database as an OLE object.
In concept the above seems simple but I am having all sorts of difficulties with it.
Can anyone point me in the right direction or offer some code to help. I have read the MSDN information until it is coming out of my ears but it has not helped.
Thankyou in anticipation
MS Word Embedded Objects
I am having all sorts of trouble using embedded MS Word OLE's in a Visual Basic application.
I am a novice with VB and what I am trying to do should be as simple as pie.
I want to click a button which will allow me to read an OLE field from an Access database and store it on a form. When I am happy with all the details on the form I want to update the database with the mdified OLE document.
Below is the code I have written but I obviously have the objects messed up as it does not work.
Any assistance would be greatly appreciated.
____________________________________________
Option Explicit
Dim WB As Object
Dim Word As Object
Dim embeddedDoc As Document
Dim appWrd As Word.Application
Dim intChunkSize As Integer
Private Sub cmdOpen_Click()
'This routine is supposed to load up the OLE object on the form with the contents of the
' "Worddocument" field in the Access database
'
strTestword = "Select * from Testword where Control = 'Control'"
rsTestword.Open strTestword, dcnTest, adOpenStatic, adLockOptimistic, 0
intChunkSize = Len(rsTestword("Worddocument"))
OLE1.object.object = rsTestword("Worddocument").GetChunk(intChunkSize)
rsTestword.Close
End Sub
Private Sub cmdSave_Click()
'This routine is supposed to save the OLE into the database into a field
'called Worddocument which is defined in Access as an OLE.
'
intChunkSize = Len(OLE1.DataField)
strTestword = "Select * from Testword where Control = 'Control'"
rsTestword.Open strTestword, dcnTest, adOpenStatic, adLockOptimistic, 0
rsTestword.Fields("Worddocument").AppendChunk OLE1.object.object
rsTestword.Update
rsTestword.Close
End Sub
Working In MS-word Embedded In VB
Dear All
I am developing an Data entry application using vb6.0.Users use to key by looking into the images.For images to view i am providing kodak image, for keying I am serious looking for having the ms-word document embed in vb6 since the keying requires all the stuff embedded in ms-word like paragraph,heading, subheading,etc.,
Is it possible?If so how to use it.please explain.
Regards
Sasikumar
=
Auto-Update Website Based On Excel Worksheet PLEASE HELP!
I'm wondering if I can automatically update a certain page on a website with information from an excel document. The excel worksheet has information that updates automatically(got this part done), and I want the page on the website to update with the information from the excel worksheet every 10 seconds. How can I do this?
|