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




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.




View Complete Forum Thread with Replies

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

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

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

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?

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

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

Events From Embedded Objects
I am attempting to create an ActiveX controller which contains a webbrowser control. Inside of the web browser control I have also embedded another object using the document property and html. I would like to extract events from the object embedded in the browser control at the controller level. Is there anyway to do this?

I know already that when the web browser control is embedded in a controller you cannot access the events of the web browser, but what of the events of the object embedded inside of the browser?

This is specifically related to DVD playback

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

Embedded Objects: BackStyle Property
Hello All!...
This seems to be a Excel Glitch... but you will know this better than I...

Here is the setup... I am using embedded "OptionButtons" that I have set the BackStyle Property to Transparent.

However, when I click the OptionButton the Control BackColor appears as if I had changed the BackStyle Property from Transparent to Opaque...

Here's the interesting part, when I show the Properties List for the Optionbutton the BackStyle Property still shows Transparent.

I have tried to reset the BackStyle Property at Runtime but with no luck...

This would not be such a big thing if there was (is) an easy way to match the BackColors of both the sheet the control is embedded in and the control itself... I played with this idea for well over an hour this weekend using the macro recorder and actually changing the color code in the Property Settings but it seems the BackColor Palette for sheets uses different hue settings than those for Controls...and thus makes this a very ardous task of trial and error.

Any help or insight with this would be, as always, greatly appreciated

Thanks
RT91

Storing Embedded Objects In SQL Server
I have an application in which I need the ability to store files as embedded objects in a SQL table. I have been able to achieve this using an ADO Stream however I would like to know if it is possible to retrieve information about the file itself, such its name and extension, so that I can open it (similar to an OLE Object??).

The only way that I have found so far is to save the file back to the disk and then open it, for this to work properly I would need to create an extra field in my table to hold the original file name. This is also an overhead for big files if they need to be saved and removed after every viewing.

Please find attached my code so far and a script of the table that I am using. Any help would be greatly appreciated as I am going around in circles at the moment.

Thanks



Edited by - pnewman on 4/22/2005 8:29:23 AM

Linked && Embedded Objects In Word VBA
From my udnerstanding, The M$ Word object model exposes two types objects that assist in OLE linking and embedding: inlineshape and shape.

What I'd like to do it to display either an inlineshape or a shape (determined at runtime) on a Word VBA Form in such a manner that I do not have to worry about what the Type property of the shape/inline shape is or if the object is a inlineshape vs a shape. Does anyone have any ideas?


V/R,
Chris

Copying Spreadsheet With Many Embedded Control Objects
Hi Guys

I have a major headache of a problem...... and desperately need some advice and help.

I have a spreadsheet which has some 40 interdependent objects - mainly dropdown combo boxes.

I need to generically copy the spreadsheet at run-time.
The spreadsheet has not been created as a class object.
I am using Excel 97.

When I copy the spreadsheet all the controls loose their names and take back name combobox1, combobox2.

If I do a dummy copy I can identify which object number points to eac control and could rename the controls in the copy process but this seems very cumbersome to me. In my head the obvious way to do it is to make the sheet a CLASS sheet and create new versions of the sheet, depending on how many pages of the sheet I want.

My problem is that I am very lacking in developing with collections and classes. I would need someone to hold my hand and walk me through the process of creating the sheet as a class object and then creating a new instance of the sheet.

Can someone please give me some advice and pointers to try and get this to work in the most economic and efficient manner.

Thanks ever so much

Regards

Retrieving Information From Embedded Flash Objects
Does anyone know if it is possible to embed a flash object and relate to it in code.

Specifically:
Flash Button Clicked - envoke vb event
vb event - flash reaction


Any help would be great!

Matt

Iterating Through Word Doc W/ Tables,pics, Embedded/linked Objects
Hello All,

I was wondering if anyone could help me with a problem I'm having in VBA Word2000:

I need to iterate through a word document a process each item as it appears in the documents. As I understand it, the items I might be looking for include paragraphs, tables, pics, embedded/linked objects. Does anyone know where I could find a complete list and more importantly, how I can iterate across ALL of them as the appear in the document?

I already see that there are a bunch of collections in place inside a document. Will I have to determine the order of all theobjects in all the collections manually?

Lastly,
I have in front of me Wrox's Word 2k VBA book but I'm trying to get some more detailed reference information ... if you know of some pls lemme know.

Modifying Crystal Report Text Objects With Embedded Fields?
Is there any way to do this? The embedded field just comes back as "[]" (eg Date: []), and if you try to modify it the embedded field disappears altogether.

Dylan

VBA - How Can I Get An Objects Collection From A Worksheet?
Hi Guru,
I have a worksheet populated of option buttons, check box and combo box, cells with value. I need to reset all of them into one simple button click.
Is it possible?

Thanks
kaiala

Why Don't Breakpoints Work In Embedded Visual Basic ?
Hi all. I start a new evb project, choose pocket pc 2002 emulation as the target, put a breakpoint in the code and then hit F5. The emualator starts and i can choose the project from the start menu in the emulator and run it, but the breakpoint does nothing. What stupid obvious thing have i missed ? Incidentally, after hitting F5 you can still edit the code in the ide, like the code isn't actually executiung in the ide, but rather only in the emulator. Please Help !

Creating And Changing The Property Of Worksheet Objects (scrollbars).
G'day,

I am writing code to create a new sheet, do some formatting, add some information and formulas to cells. The procedure also creates a scrollbar and I want to change some of the properties (see below).

Here is my code for both creating and changing the properties of the scrollbar:
Code:
'Place a scroll bar and link it to the test selection sample
ActiveSheet.OLEObjects.Add(ClassType:="Forms.ScrollBar.1", Link:=True, _
DisplayAsIcon:=False, Left:=123.75, Top:=38.25, Width:=144, Height:= _
12.75).Select
With Sheets("Substantive Testing").OLEObjects("ScrollBar1").Object
' .LinkedCell = Range("sample")
.LargeChange = 12
.Min = 24
.Max = 240
' .PrintObject = False
' .Shadow = True
End With
The lines that have been commented out are the ones that produce errors - all the rest works fine.

I am using Excel 2002 (platform = WindowsXP), and this is using vba.

Thanks,

Mitch

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.

Making 4 Class Objects Work Together - Confusion
Hi!

I am working on a hallplan application. The application includes a graphical component that is responsible for all painting operations, and 4 class objects that represent hall plan entities.
The four of them are:
clsHallStand - represents each individual stand on the hall plan
clsHallStands - represents any given collection of clsHallStand objects on the hall plan
clsHallLayoutSquare - represents each square meter of the stand
clsHallLayoutSquares - collection of clsHallLayoutSquare objects.

This hierarchy is necessary for me to save the information to the database. There's one more top-level object called clsHallPlanManager that translates clicks and other operations on the graphical component to the 4 objects above, as well as paints the hallplan from the information in these objects. For example, a stand may contain 6 squares. Each square object contains a property OwnerStand of type Long. The stand object, in turn, contains properties CompanyName, StandNumber, etc. When the hall plan is painted, the clsHallPlanManager invokes method GetSquares on the clsHallStand object, retrieving each individual square, then invokes PaintRectangle and DrawText methods of the graphical component.

However, I have a difficulty getting something. In what way can I get a collection of all Squares within one stand? THe GetSquares method of clsHallStand object should do this, but it does not know where to look for the squares. Should another component be doing this, or should I just declare
GetSquares(ByRef AllSquares as clsHallLayoutSquares) so the method knows where to look?

Also, if I pass an object ByVal or ByRef to a function, does that increment the reference count of the object? Is ByVal different from ByRef when used with objects?

Thanks a lot in advance!!!
Stas

Delete Worksheet, Then Create New Blank Worksheet With Same Name
Hi

I have a worksheet named "Harmonics", where I present to the user the results from my VB program.

But when the user re-runs the macro, I want to ensure that ALL the data on the worksheet is overwritten and no 'old' data is still there.

I thought the best way to do this would be to delete the entire worksheet at the start of the program then re-create the worksheet as a blank document ready for writing to. Is this a bit extreme? Would I be better to just delete all cells within the worksheet as opposed to the sheet itself?

Your help would be most appreciated.

And of course, some code to do what I want would be great!

Thanks,
Daryll

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?

How To Check If A Worksheet Exists In Worksheet Collection
Hi All,
   I wanted to know if there is any method to check if a worksheet exists in worksheets collection.I want to check this by worksheet name.

Thanks in advance

Regards
Raghu

Changing Worksheet Name When Copying Worksheet
Hi guys I have an Excel problem. I am having a worksheet and i duplicate it when i need to have it more times. Therefore I use the following code:


Code:
ActiveWorkbook.Sheets("Template_Sheet").Copy After:=ActiveWorkbook.Sheets(1)
When I copy the "Template_Sheet" Worksheet I get one with the name "Template_Sheet (2)"
How can i make the new copied Worksheet have the name I choose for it?

Thanx for any advice

Objects In Behind Other Objects Covering Up Objects Infront
I've been experimenting with direct 3d and I came across a snag. It seems that regardless of the z cordinate the objects are displayed in the order they are drawn. So if object1 is supposed to be behind object2 but is drawn after object2 object1 will actaully be drawn over object2. Is there a slick way around this problem.

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

Resizing Objects Bring To Front Other Objects In SSTab
Hi.
I've got a SStab object with 3 tabs. Each tab has one MSHFlexGrid.
These object are in a MDIForm Child.
When I resize the child form, i'll do this code:


Code:
'Consultas is a form
'every object started with Grid is a MSHFlexgrid
Public Sub FormConsultas()
On Error GoTo Erro

Consultas.SSTab1.Height = Consultas.Height
Consultas.SSTab1.Width = Consultas.Width
If Consultas.Width < 11925 Then Consultas.Width = 11925
If Consultas.Height < 8055 Then Consultas.Height = 8055


Consultas.GridFactESDDExp.Move 90, 600, Consultas.Width - 420, Consultas.Height - 2000
Consultas.GridAcordoHorasFech.Move 90, 600, Consultas.Width - 420, Consultas.Height - 2000
Consultas.GridAvisosCobrancas.Move 90, 600, Consultas.Width - 420, Consultas.Height - 2000


Erro:
Select Case Err.Number
Case 0
Case 384
Case Else
MsgBox Err.Number & " - " & Err.Description & " - " & Err.Source
End Select

End Sub


What happens is: after resizing the form, sometimes, the grid of the 2nd tab persist visible when tab 1 is selected.
What can explain this behavior, and how can I avoid this?
Thanks

Creating Business Objects Reports In Visual Objects
hi all
i want add business objects Universe in visual basic.
(universe is a query on source data base).
i want to access data from universe and i want to create report in vb. can u help me out.
regards and thanks.
james

Copy From Worksheet To Worksheet??
I need to copy info from one cell in worksheet1 to another cell in worksheet2. The problem is I have a formulated cell in worksheet1 and when I copy from worksheet1 to worksheet2, it copies the formula. I need to copy the value only. Here's the code I'm using.

Worksheets("BT WORKSHEET").Range("A60").Copy
Worksheets("REQ.").Select
Worksheets("REQ.").Range("B11").Select
Worksheets("REQ.").Paste

Thanks for any help.

To Copy Worksheet At The End Of Other Worksheet
I WANT TO KNOW HOW TO COPY THE EXCEL WORKSHEET AT THE END OF OTHER WORKBOOK SHEET.
I HAVE WRITTEN CODE IN VB6.0 BUT IT OVERWRITE THE WORKSHEET WHILE COPYING.

Private Sub File1_Click()
Dim FileToCopy As String: FileToCopy = "T:PRODUCTIONPRODUCTION FILESELECTRONIC PRODUCTION CONTROLSMASTER_FILECAP 8 MASTER FOR RS232 V.95.xls"
Dim NewFile As String: NewFile = "T:PRODUCTIONPRODUCTION FILESELECTRONIC PRODUCTION CONTROLS2005" + File1.FileName
FileCopy FileToCopy, NewFile
Exit Sub
End Sub

Private Sub Form_Load()
Me.Show
Me.Caption = "Copying..."
File1.Path = "T:PRODUCTIONPRODUCTION FILESELECTRONIC PRODUCTION CONTROLS2005"

End Sub

Embedded Visual Basic Vs Embedded Visual C++
Hi,

Other than language syntax difference, which one is preferred to use? What are the difference and benefits?
Thks...



Edited by - roniwu on 10/7/2005 8:47:14 AM

Load Objects With Designated Parent Objects
When I load a new object, for example:

Load cmdExecute(5)
cmdExecute(5).Visible = True

Ect .. How do I specify the parent of this object? A frame for example ...

Thanks.

For...Each With A Dictionary Of Objects; Send Objects By Parameter
Hi

I have two problems

First
I have a dictionary of objects (Sentence). I want to do a For...each, to modify all the objects in my dictionary but I want to use them by ref

dSentences: Dictionary
Sentence: Object
Display: Sub of Sentence
********************
Dim sKey As Variant

For Each sKey In dSentences
Debug.Print (sKey)
dSentences.Item(sKey).Display 'To use them directly in the dictionary
Next
********************
Results:

"key1"
"Value3"

"key2"
"Value3"

"Key3"
"Value3"

Gives only the value of the last Object of the Dictionary. I don't understand because the sKey always change
Maybe my syntax is bad, but it executes Display.

The second one: how to send objects to other subs by ref? I tried the traditional way but it don't seems to work

Thanks for your help

Objects: Incorporating Arrays And Other Objects
Hi, I'm new.

I am just learning OOP and am trying to create a "camera" object. What this camera does is "takes a picture" of arrays of points and lines in 3D space and puts it on a PictureBox using Visual Basic's PSet and Line methods. I had been using this camera frequently in non-object form, but distributed in different subs, (e.g. to orient the camera, to move the camera, to change its sensitivity, etc.).

I am using the VB5 professional edition and am confused about two things:

1) Visual Basic does not allow arrays to be public members of Objects:

Option Explicit
Public Point(32000) as Point3D 'Gives Compile Error
Public Line(32000) as Line3D 'Gives Compile Error

I can work around this by using Private arrays and transferring data one at a time from the outside with a loop structure. However, this doesn't seem eloquent to me. Is there a leaner way to fix this?


2) How do I incorporate a PictureBox into an Object? Can I make a separate PictureBox within the camera object and transfer the picture to the outside PictureBox? Or can I somehow reference the outside PictureBox to the camera object?


Any suggestions, general or specific, would be greatly appreciated .

Thanks!

Reference To Objects And Clone Objects
Hi,
I have a question about object references:

I did this:
...
Dim Collection1 As New Collection
Collection1.Add "Hello"
Collection1.Add "World"

Dim Collection2 As Collection
Set Collection2 = Collection1
...

Does Collection1 and Collection2 have a reference to the same
object?

If they do, how can I clone Collection1, and make Collection2 point at it???

Thanks,
T.

Weird Problem: F8 Can Let Code Work, Normal Run Wont Work?
I have VBA code for ArcMap, but every time when I run it , error message pops up and then my Arcmap is forced to shut off. Then I set up a check point at the place where error pops up, run it, then click F8, the whole process can be finished, very strange, could any one tell me what is the possible reason and help me to get out of it? thx in advance

Yanli

Update:

I try to add some codes (no special meaning, just to use some time) before the place where error pops up, it seems the whole process can run now, getting more weird to me, help, please!

Rotate Text Only Work To Screen, But Dont Work For Printer
Hi
Im using the follow routine to print rotate text to screen and works fine. But using this routine to print on printer, dont work, and print always on 180 degree.

Any help?

Thanks
Daniel


VB Code:
Sub Print_angular(PB As Variant, ByVal Text As String, Optional ByVal Angle As Integer = -900, Optional x As Variant, Optional y As Variant)     Dim hfont As Long, holdfont As Long    Dim Font As LOGFONT    Const GM_ADVANCED = 2    Const LOGPIXELSY = 90         SetGraphicsMode PB.hDC, GM_ADVANCED                ' Create a Font object, similar to the current font in PB        ' but with a different orientation        PB.FontSize = 6        Font.lfHeight = -MulDiv(PB.FontSize, GetDeviceCaps(PB.hDC, LOGPIXELSY), 72)        Font.lfWidth = 0        Font.lfEscapement = Angle        Font.lfOrientation = Angle        Font.lfWeight = IIf(PB.FontBold, 700, 400)        Font.lfItalic = IIf(PB.FontItalic, 1, 0)        Font.lfUnderline = IIf(PB.FontUnderline, 1, 0)        Font.lfStrikeOut = IIf(PB.FontStrikethru, 1, 0)        Font.lfCharSet = 0        Font.lfOutPrecision = 0        Font.lfClipPrecision = 0        Font.lfQuality = 2        Font.lfPitchAndFamily = 33        Font.lfFaceName = PB.FontName & vbNullChar                hfont = CreateFontIndirect(Font)        holdfont = SelectObject(PB.hDC, hfont)                ' Account for X,Y coordinates        If Not IsMissing(x) Then PB.CurrentX = x        If Not IsMissing(y) Then PB.CurrentY = y                ' do the printing               PB.Print Text            ' reselect the old font    SelectObject PB.hDC, holdfont    ' destroy the font object just created    DeleteObject hfont  End Sub

Weird Problem: F8 Can Let Code Work, Normal Run Wont Work?
I have VBA code for ArcMap, but every time when I run it , error message pops up and then my Arcmap is forced to shut off. Then I set up a check point at the place where error pops up, run it, then click F8, the whole process can be finished, very strange, could any one tell me what is the possible reason and help me to get out of it? thx in advance

Yanli

Update:

I try to add some codes (no special meaning, just to use some time) before the place where error pops up, it seems the whole process can run now, getting more weird to me, help, please!



Edited by - alaazz on 11/2/2005 6:14:01 PM

Hide Sheets/objects, Save, Unhide Sheets/Objects
There was another post about this recently. I have pieced my code together with that and the help doc. here is what I got.


Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim strCurrentSheet As String
strCurrentSheet = ActiveSheet.Name
With Application
.ScreenUpdating = False
.EnableEvents = False
End With

If Hidden_Elements_Hidden = False Then Call Hidden_Elements_Hide
If SaveAsUI Then ThisWorkbook.SaveAs Application.GetSaveAsFilename Else ThisWorkbook.Save
If Hidden_Elements_Hidden = True Then Call Hidden_Elements_Show
Sheets(strCurrentSheet).Activate

'NOTE THIS LINE
Cancel = True

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Workbooks(ThisWorkbook.Name).Saved = True

End Sub
This works fine if I manually save the workbook and then manually close it.
Although, if I just goto close the following happens. I get the save changes prompt. After it saves, I get that same prompt again.

Any Ideas?

Edit:
Is there a way to test if the document is closing in the beforesave event?

Embedded VB
Anyone know of a good reference for winsock in vbce?

EMbedded VB?
Does anyone know of a good site for tutorials on learning eMbedded VB for making programs for Pocket PCs? I notice a lot of the commands have different syntax from VB 6 - but are still quite similar i just need something to help me get the hang of it

thanks

XP Embedded XPe
Hi

I have an app on VB6 that is running on a XPe platform, however now I need to make a new program and I was wondering of moving to RealBasic (due to the single file compiler, etc) but I don't seem to get anywhere running it, not even a demo app built from RealBasic.

Has any of you got experience with RealBasic and XPe?

A bit of advice here, do you think is a good move to switch to RB or I'm better off with VB6 for embedded devices?

I have been looking into .NET but with an overhead of 50MB.... not good.

Thanks

Ed

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