Absolute Cell Position
Is there any way of obtaining the absolute pixel position of a CELL so that I can use the AddShape position to draw a shape in that cell of equal size and position of that cell?
ie. AddShape(msoShapeOval, Cell.Top, Cell.Left, Cell.Height, Cell.Width) 'Kind of thing'
Many Thanks in advance. Riyaz
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Absolute Position?
Ok back to my datacontrol thing... now I have the record count total but I want to know what record the user is on when they press forward, back, move first, or last in the data control. I have this
Private Sub Data1_Validate(Action As Integer, Save As Integer)
Dim myStr As String
myStr = "Record " & Data1.Recordset.AbsolutePosition & " of " & Data1.Recordset.RecordCount
info.Caption = myStr
End Sub
but the absoluteposition seems to return random things... such as 3 when the text box really displays record 0 and 2 when its really on record number 4. ... am I using this wrong?
complete code
Code:
Option Explicit
Dim rs As Recordset
Dim tCnt As Integer
Dim myPos As Integer
Private Sub Data1_Validate(Action As Integer, Save As Integer)
Dim myStr As String
myStr = "Record " & Data1.Recordset.AbsolutePosition & " of " & Data1.Recordset.RecordCount
info.Caption = myStr
End Sub
Private Sub Form_Load()
CommonDialog1.ShowOpen
Data1.DatabaseName = CommonDialog1.FileName
'Set rs = .OpenRecordset("AUTHORS")
Data1.RecordSource = "branch"
Set Data1.Recordset = rs
Data1.Refresh ' Open the recordset
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
Text1.DataField = "branch_name"
tCnt = 1
End Sub
Absolute Position
Hello...
what the different between selbookmark and absolute position in datagrid...?
i can get the current pointed recordset with that two, can't i ?
how if i do a multiple select ? how absolute position works in multiple select?
thanks,
ganero
.Absolute Position
I have a code errors out telling me I have an invalid key. The code it errors on is as follows:
Do While Not rs.EOF
.Add rs.AbsolutePosition + 1, rs!Site_Number, rs!Site_Number
rs.MoveNext
Loop
(it errors at the .ADD rs line)
I can't find any help on the invalid key error. Anyone have any suggestions?
Thanks
Pat
Absolute Position
I am trying to use rs.absoluteposition to keep incrementing the count on a label, but this always seems to stay at -1. Any ideas?
Thanks!
Erica
Absolute Position In A Query
Hi, using DAO and Access, is there a way to know the exact position of a record in a query ? Like absolute position or something ?
Many Thanks
Absolute Position Of A Record !!!
Friends,
How can I view the number of exact row in a label that is currently showing the data.
Something like this: Record 15 of 75
Help needed please.
Absolute Control Position
ok i want a function 2 find the absolute position of a control on the form.... for example if the control passed in is in 2 pic boxes it will return the twirps to the top left of the form
- i will be doing this kinda thing abit so i need a generic function -
thanks kris
Absolute Control Position?
How can I know the absolute position of a control on a
form, using the upper left corner of the form as 1,1
These controls may be put inside other controls (nested)!
Would anybody help?
Any hint?
Thanks
Absolute Position In Data Reports
How can you print out an ordered sequence to number the records in a VB data report? The function control won't go into the detail section, and calculated fields only work if you have other fields to calculate from. It seems so easy in Access (number grouping), but why not in VB? Any ideas?
Record Count And Absolute Position
On my form I'm trying to display the number of recoreds in my Access DB and also the current position I'm at but I'm having no luck. Currently i'm using the below but I keep getting -1 of -1 displayed. Can anyone see what is wrong?
Thanks
Code:
strCn = ConnectString()
sSQL = "SELECT * FROM tblBuy ORDER BY Completed DESC, Date DESC"
Set rsEditBuy = New ADODB.Recordset
rsEditBuy.Open sSQL, strCn, adOpenDynamic, adLockOptimistic
lblTrades.Caption = rsEditBuy.AbsolutePosition & " of " & rsEditBuy.RecordCount
Absolute Character Position In Richtext Box
I am trying to auto generate some text in a richtext box. Characters will have different sizes and be of different widths.
I need a way to line up the tabs inbetween things. Sometimes I need 2 tabs, but most of the time I only need 1 inbetween things (Sorry if this is vauge, I will attach an example if needed).
The only way I can think of accomplishing this is by testing the absolute position of a character from the line above and if absolute position of the current character matches that then leave the tabs how they are, otherwise add a tab until the tabs line up.
I searched through the object browser for a good hour testing all the different properties of the richtext lib, and nothing worked. SelTabs looked promising but it always returns 0 for some reason.
Any ideas?
ADO Record Count And Absolute Position
I finally figured out how display the record count of a table or query as well as the absolute record being focused on, but I am getting eroneus numbers -1 of 26 and when I click on the right or left arrow the counter wont increment (or decrement) unles I click the arrow twice. I put the statement in the form load:
Adodc1.Caption = " " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount
and then I put it under the click sub for the Adodc1 control:
Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
Adodc1.Caption = " " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount
End Sub
Any suggestions on how I can get the proper results? Also when a query is run and produces no results, I would like the "counter" to display 0 of 0 instead of -1 of 0 and the control seems to be shaded like Enabled = False. DAVE
Visio - How To Move Shape To Absolute Position?
Hi,
Thanks for taking the time to look at my post.
I would like to move a shape object to an absolute location of my choice, e.g. I would like to know how to move a shape object to position (100, 100).
The selection object's move method only allows the selection to be moved relative to where it's original position was.
here is the code:
VB Code:
Sub start() Dim aShape As ShapeDim aSelection As Selection Set aShape = Documents(1).Pages(1).Shapes(1) ActiveWindow.Select aShape, visSelect Set aSelection = ActiveWindow.SelectionaSelection.Move 2, 2 'i want to move to an absolute location, not just 2 up and 2 right like this line doesEnd Sub
Thanks for your time
<>GT<>
Absolute Position A Text Box In Word Macro ??
Hi Guys
Wondering if anyone can tell me if its possible (and how to) absolute position a text box in a word macro....
I have a word document that runs a macro that places a text box on the page containing a barcode. The word document contains text that is editable by the user. However, if the user edits the text, the text box moves as if it is set to position relative to the text. I need the text box to remain in the absolute same spot all the time.
Please, any info on this would be much appreciated.
Nick
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
Server Side Cursor Recordset Absolute Position
I apologize in advance for this one since I have seen a solution for this some time ago, but cannot seem to turn it up in a search.
I am using a server side cursor (This will be an advantage for several reasons, so I will not want to change this).
I only need to determine the recordset absolute position and the recordset count so I can display "Record 1 of 25" or whatever.
I do a move last then a move first, but still receive the values of -1 for both absolute position and count.
I am using VB6 with SQL Server 7 ADO connection
Terry (cyberbiker)
Finding All Links Absolute Position X,Y Relatively To The Screen In VB6 WebBrowser
Finding all links absolute position X,Y relatively to the screen in VB6 WebBrowser
There is a Visual Basic 6 application with WebBrowser in it.
This application is about statistical information on what html tags were loaded, where they are being located - it's position X,Y
For example I want to find Document.getelementsbytagname("a") link and anchor position on the screen, how do I do it?
There is example in JS, that I could inject into webpage by scriptcontrol but could I do in in VB6 itself?
function getElementPosition(elemId)
{
var elem = document.getElementById(elemId);
var w = elem.offsetWidth;
var h = elem.offsetHeight;
var l = 0;
var t = 0;
while (elem)
{
l += elem.offsetLeft;
t += elem.offsetTop;
elem = elem.offsetParent;
}
return {"left":l, "top":t, "width": w, "height":h};
}
Trying by vb6 in webbrowser
Dim WithEvents doc As HTMLDocument
Dim elem As IHTMLElement
Set doc = ie.document
For x = 0 To doc.getElementsByTagName("a").length - 1
Set elem = doc.getElementsByTagName("a")(x)
I want convert this nonsense
'"-PParent=" & elem.offsetParent.offsetParent.tagName & "=" & elem.offsetParent.offsetParent.id & _
'"-3Parent=" & elem.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.tagName & _
'"-4Parent=" & elem.offsetParent.offsetParent.offsetParent.offsetParent.id
To while loop, but I can't figure it out how
While (TypeOf elem Is IHTMLElement)
parentall = "-Parent Tag=" & elem.offsetParent.tagName & _
elem.id & ",l=" & elem.offsetLeft & ";t=" & elem.offsetTop & _
Set elem = elem.offsetParent
Wend
Next x
Absolute Value A Formula In A Cell
I'm writing a macro that goes through a bunch of cells and deletes any that are greater than 0. These cells are holding a formula. I now want to go back over these cells and insert an absolute value property or change the format of these cells to show the absolute values of the formula. This is difficult because I still want to show the formula and not just absolute value the cells value. Please help......
About Changing Cell Values To Absolute Values..
Hi there. I got a worksheet containing 3 columns of thousand values. In colume 3, cell values were set as "=a value in column a", eg value of range c2 ="=a3". However, after filling in values in column 3, I tried to sort the values in column 3 in alphabetic order, the values in columns 3 were changed to "=REF!". I know it's about values not being set to absolute values. As there are thousands of values in column 3, Can I use VBA code to change them to absolute values once for all (e.g. change "=a3" to "$a$3)?
Cheers.
How Do I Shift A Cell Position?
Hi all,
Badly need help here. I am trying to create a macro that I will activate with a command button. After clicking on the button i will click on a cell in my table then click on another part of the table. this will cause the whole row of data from my first click to move on top of my second selection. Please help. Thanks
Delete Cell With New Position
I have this list of the data as it show in the pic and I tried this code to delete the roes of cells on condition if the first cell =4
I want after delet this row it don't left a space between the rwos
As it show in the pic
Code:
If Cells.Value = 4 Then
Cells.vaule = ""
Cells.Offset(0, 1).Value = ""
Cells.Offset(0, 2).Value = ""
Cells.Offset(0, 3).Value = ""
Cells.Offset(0, 4).Value = ""
End If
How Do I Get An Integer Value For Cell Position?
Hi there Ho there,
I'm trying to get the column number of a cell so I can compare it to an integer value (ie if column No > Number then...).
How do I get the column number of a cell so I can do this. The address value returns a string and this is no good unless there is a way of converting?
Any help would be much appreciated!!
Thanxs
ActiveWorksheet Name And Cell Position
I have a problem in VBA.
I have 7 sheets, I am trying to copy all the data from sheet1 to sheet5. When I go back to sheet1 by cell position is at the bottom of last row. How can I get the cell position(black square) in to top of the sheet? Please ............
Excel: Determining Active Cell Position
I am writing a VB Excel Macro and I am using the following code to determine the position of the active cell.
VB Code:
Dim InitialRow As Integer Dim InitialColumn As String InitialRow = ActiveCell.Row InitialColumn = ActiveCell.Column
The problem is ActiveCell.Column returns an integer (i.e. it returns 3 instead of C). Does anyone know a way to return a C, or to convert the 3 to a C)?
If someone knows a function to return the full cell name (Column & Row instead of Column and Row individually), that would also work.
The reason that this is a problem is because I want to select this cell later using the function Range(<Cell>).Select, where Cell = String & Integer
Range Selection Relative To A Single Cell Position
This is my very first attempt at any kind of programming, so forgive me if the query seems rather basic.
I have programmed a macro to locate a cell with a desired value. Now i want to select a range, whose position should be relative to the position of the desired cell.
Basically lets say if the desired cell is found to be C4, then I want to have the macro select the following range: Range(A4:E4). If the cell is C6, then i want to select Range(A6:E6)
I have tried various things with the offset function, but can not seem to get it working.
Would really appreciate your help.
[B]Problem Of Keeping Cell Link In Fixed Position[/B]
I have cell links to certain cells which I need to move and replace by new cells. However, I'd like to preserve the original cell links, but they are are automatically moved when the cells are displaced (f.ex. with the cut'n'paste function).
The thing is that I need to insert new columns, but need to maintain the links to column C, despite the fact that the original content of this column will be moved to the right in the process. Any idea how to solve this i VB?
Thanks in advance!
Spock
Cell Format, Determining Type Of Cell Content (string/real/integer) And Cell Size
I am not sure whether I am at the right forum, but I am exporting Excel values in a Word document.
Unfortunately -my copy paste action doesn't take in account the cell_properties, so in some cases a value of 9,9999999999999999999999999999998E-4 is entered instead of the 9,9 E-4 or even 0,001 that is shown in the excel sheet.
I'm having trouble with finding the set format command (e.g. Tutbo Pascal: write(value:8:3) -or someting) and I also have strings in these cell -I am not sure if it gives any problems if one sets every zell to 2 decimals, if so -ho can I determin the type of cell content ...
And how to set the cell size to size of content
Could anyone help me, I 'm much obliged
Writing A Cell Address Of A Cell In 1 Worksheet To A Cell In Another In Same Workbook
Hi……..
Its an urgent requirement….
I have an excel sheet. I need to write the macros in VB for the following requirement:
There are three worksheets in a single workbook.. worksheet3 contains some values in every cell. whenever user writes in something in the cell in worksheet1, the column number and row number from worksheet3 must get written automatically in the adjucent cell in worksheet1 only.
For example:
A worksheet 3 contains PLZ A,B in row 5 and column 7. These rows and columns are user defined. If i write PLZ 31, 20 in F26 in worksheet 1 then automatically G26 must contain value 75, G27 must contain a value 31 and G28 must contain a value 20.
I can't say when this value should get populated. Either on the lost focus of F26 or i need to run a macro manually for F26.
what would be the code in both the cases? Is the former case possible? If i select group of cells like F26 present in worksheet1 and altogether run a macro then would it give the result?
Thanks in advance for your reply.
Regards...
Priyadarshini
Absolute Value
Is there anyway in Vb to use the absolute value of some number????
Absolute
Hi, anyone knows how to make a variable positive?
For instance, I need variable Time_Diff to be positive even if the calculation turn out to be otherwise:
Time_Diff = DateDiff("n", Date1, Date2)
Thx
ABSOLUTE Security
Only people familiar with the RSA Algorithm or Public Key Encryption respond unles you have a good soultion, please.
I have created a very secure connection program using RSA for an envelope to a random RC4 Key. However, i want this program to be absolutely secure.
The man-in-the-middle attack is my only standing opponent.
This attack works as follows...
Person A wants to send a message to Person B, so he attempts to connect.
1. Person X catches A's message, reads it, connects to it and sends his own request to Person B. So we have a layout as follows....
A----[Insecure Network]------X----[Insec. Net.]--------->B
2. A sends his public key to X, thinking that X is actualy C.
3. X captures the Key, records it, and sends his own key.
4. C recieves the key, and sends the encrypted passphrase back to X.
5. X records the passphrase, encrypts it for A, and sends that to A.
6. Any message sent from A to X to C can be read by X.
7. Any attempt to authenticate can be changed by X
Here is my dilema: A one time Pad would solve this problem if you could negotiate the Pad beforehand, but i would not like that kind of hassle.
Any thoughtful authentication ideas are helpful.
Absolute Values
Hi
How can I create absolute values in vb?
In other words, how would I write |-a|?
Thanks
VB6 Absolute Beginners Need Help
My daughter and I have a VB problem and need any suggestions on how to proceed or locations of relevant tutorials.
My daughter recently announced that she wanted to learn VB and as my knowledge of it does not extend beyond the name of the program I bought her several books on the subject, VB 6 Enterprise and I am sitting with her most evenings, trying to work through it all.
She has been given a few sample projects to work on by a helpful teacher, but this is where she has stumbled and my lack of knowledge shows up. My usual source of assistance cannot help in the short term due to an outrageous work schedule, so rather than wait for his visit scheduled for two weeks time I hope someone out there can help.
The problem is a series of drawn objects (lines, rectangles and a circle) meant to loosely represent a lighthouse. There are other lines to represent the lighthouse rays of light called linBeam1 through to linBeam4. No problems so far.
Now there are 2 labels. One says “high tide” and is visible, the other says “Here is the lighthouse” and is invisible. Again, no problems.
Below the “high tide” label is a text box for a simple password that is displayed as **** and has to be accepted in either case. So far, we can manage.
Getting the password text box to change its background colour and show the invisible “Here is the lighthouse” label is relatively easy when the correct password is entered, even for me.
The trouble comes with the following;
A LightState value of 0 has to be set in the Private Sub Form_Load() area.
Now a timer has to be added and its variables changed to show the lighthouse light lines and the circle object that is the top of the lighthouse when the correct password is typed into the password text box using a timer sub procedure.
She also has to use for...next statements to generate a timed loop with a delay of around 2 or 3 seconds for the lights and the top of the lighthouse to appear and ‘glow’.
If any of the above seems anything like English to anyone out there, Gemma and I would be very grateful to be prodded in the right direction. She is getting frustrated and I am getting totally lost, and nothing would please me more than to get her beyond this stumbling block.
Thanks in advance for any suggestions (preferably polite)
How To Get Absolute Path Using The DSN Name
Can any body please let me know.
How i can get the network path of a database using the DSN Name.
Because i use DSN connection to the Database from VB.
But i am generating the ACcess reports from VB. when i create the access.application.9 using opencurrentdatabase.
i have to give the network path of the database to run the reports instead of using the DSN.
Is there a way i can first get the Path of the Database using the DSN and then use that path to run the reports back on access.
Please let me know.
Thank you very much in advance.
Absolute Focus
Hey, at the moment, I'm making a program which 'locks' your computer, as in, you run it, it's full-screen, you can't move the window around, and the task-bar is hidden when in lock mode (for the added you-can't-go-here feeling)
However, when I do run the program, its easy to bypass the security by pressing alt+tab, or ctrl+alt+delete. So, how do I make the program have total focus, and have those two key combo's unable to do a thing?
Help,what Command Is For Absolute Value?
hi im doing recording value from device..it does records down the (-ve) value where i just want the (+ve) value..can anyone help me up.. im really in deep **** now..my supervisor keep on pushing me..
best regards,
James
Absolute Value Of An Integer
Without using Abs() - what ways are there to make an integer positive?
I tried a rather clumsy XOR/addition method - it was slower. I'm looking for a faster way. Any ideas appreciated.
edit: although, in the process, I have found umpteen ways to negate an integer
Absolute Value Of Numbers
I am trying to use the Abs function to return the absolute value of a range of numbers. The range includes both positive and negative numbers. The numbers are also being formatted as currency. The code I'm using is returning the value of the positive numbers minus the value of the negative numbers.
VB Code:
lblFinImp_r.Caption = Format(Abs(CCur(txtTmpVal1 + txtTmpVal2)), "$#,##.##")
What am I doing wrong?
Absolute Values
how do i get an absolute value of a number in vb? thx in advance
VB4 Absolute Beginner
As an absolute beginner I am trying to teach myself VB and have come upon a problem to which I cannot find a solution. I am trying to write code that enables three scroll bars to alter the itensity of the three prime colors in a label control. I have tried using RGB and hexadecimal values to no avail. Can someone please send me either the code or book reference.
Absolute Filename
is there a way to import a file from any folder
e.g.
Code:
OLEBound1.SourceDoc = "C: empfilename.xls"
this is the line of code but i don't want the folder or drive i just want to say that it's in the same folder as the db.
Code:
OLEBound1.SourceDoc = ".filename.xls"
but this doesn't work.
Thank You
Absolute Referencing In VB
I have a code, so when I click on a button, it displays a image. This won't let me write a short path like "imageshi.jpg". I have to write the full path "C:My Programimageshi.jpg" when I compile this, and send it to school. I'll be running off a H: so the path is different. Is there anycode that chops down the path? This is for my computing project and it will be marked on a different machine to the one I am writing it on.
Thanks in advance.
|