|
atulkhandekar wrote: Presently, i have calculate through excel formula but calculation is slow due to thousand of data records & thousand of formula. And it will take very long time. Not much you can do about that, other than reducing the number of records. You should check that your formula(s) is the most efficient way of doing it.
atulkhandekar wrote: Now i required to calculate through vba micro to speed up our work. It is unlikely that doing this with a VBA macro will make it any faster, more likely the reverse.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
You can try pivot table. See more in inbuilt help.
|
|
|
|
|
Hi guys I have little bit Complex Algorithm to solve my little application using IF function.
I'm working on a little game using VB for that.
I have 12 buttons 3*4 three column and four rows. imagine these buttons as river and in the left or on the right side of the river there is a man would like to cross the river using these buttons as bridge.
the basic idea is if user presses the button there is message will show a question Yes or NO. if the answer is correct button turned to green otherwise will be blue if the answer incorrect.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x = MsgBox("moon is biger than Sun", MsgBoxStyle.YesNo)
If x = DialogResult.Yes Then
Button1.BackColor = Color.Blue
Else
Button1.BackColor = Color.Green
End If
End Sub
End
[Button 1] [Button 2] [Button 3]
[Button 4] [Button 5] [Button 6]
[Button 7] [Button 8] [Button 9]
[Button10] [Button11] [Button12]
case 1:
the player can go from 1 to 3 horizontal
also allowed to go diametrical or free direction like : 10 and then 7 and then 8 and then 9 OR
Case 2:
from 7 and then 9 and then back to 8 .
Case 3:
or 10 to 8 to 5 to 3
case 4:
9 to 5 to 7
a lot if cases players can goes with to win
Finally
a message will show up ( the player win if he answers correctly )
this is my Big problem I have to study all the case and using IF
not the correct method also I cant go with Switch method
then I found out I have to use math Algorithm ..
each button has value like button1 take 10 value if the answer correct and button2 takes 20 and button3 takes 30 value.
by this way I can use IF function or switch ...
because if the total comes to 60 the player will win
but still Complex Algorithm for me
what I should do if the player has free directions to win .
Player has random choosing
I got headache to just think how can I solve probabilities that user may use it to win.
I know that to make my life easy just I have to make rules but I try to challenge my self with open direction how can I solve this problem
|
|
|
|
|
..typically, there's a function that returns whether a particular move (based on startpos and desired endpos as arguments) is valid. Then you call that in loop.
|
|
|
|
|
I am developing a simple programe in vb6 with ms access database, currently this programe run in a computer , now we go to work this programe in 4 computer , how can i share the access data base ... now i am using following codes
Public CnCargo As ADODB.Connection
CnCargo.Open "Provider =Microsoft.ACE.OLEDB.12.0;Data Source=F:\Invoice\Invoice.accdb;"
**** if the database path is working based on ip address it is very good ....
**** how can we configure INI file database path
please advice , if know
regards
mano
|
|
|
|
|
If I understand it correctly, you want to place the access MDB on one computer, make sure that folder where the MDB exists is shared, then you configure the connection string to reference the MDB something like "...Data Source=\\yourServerComputer\YourShareName\Invoice.accdb"
|
|
|
|
|
yes u correctly understood , but we are not maintaing server computer , and then it is not mdb file it is accdb file
please help
|
|
|
|
|
Hi everyone,
I have this declaration:
Sub CreateTablePessoas(db As Database)
End Sub
And then this:
Sub CreateMyForm()
Dim db As Database
Dim tdf As TableDef
Set db = CurrentDb()
Set tdf = GetTable("Pessoas", db)
If tdf Is Nothing Then
CreateTablePessoas (db)
End If
End Sub
But when calling CreateTablePessoas(db) I get error 13: incompatible types (I'm translating the error message from portuguese, so I'm not sure that's how it would display in english).
I'm not much of a VBA guy, so what's the problem here?
Thanks in advance.
Fratelli
|
|
|
|
|
Got it:
Call CreateTablelPessoas(db)
Fratelli
|
|
|
|
|
If you take out the brackets(parentheses) you should be able to manage without the Call as in:
CreateTablelPessoas db
This one always used to catch me out too...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I have setup a datagrid and successfully filled it with data and always the top left cell is highlighted when it opens. How do I access the value in this cell without clicking on the cell itself? The cell value must be somewhere as it is highlighted when the grid opens.
Any help would be appreciated.If I click on the highlighted cell I can get the value it contains but that's not what I want at datagrid startup.At startup the grid opens in one tab and what I want is to click a different tab and for the value to be used to populate a set of textboxes on the new tab but only when the datagrid is first activated. After that it is no problem as a new set of textbox data is obtained by clicking a datagrid cell entry. I looked on msdn and it talked about a datagrid selection start value but it doesn't exist.
jenkinsdjj
jenkinsdjj
|
|
|
|
|
Either use the source location of the data, or get it from the datagrid via its cell row and column.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks for that. I realised afterwards that I should access the data source feeding the datagrid. All is well now. Thanks again
jenkinsdjj
jenkinsdjj
|
|
|
|
|
Greetings!
I am currently working in an automation to extract data from IE. I have a scenario where two page will be accessed, the first one is the page without username and password on it and the second one is the page with login page to log username and password...
I am currently working on a code where the condition is if the account is logged is as "none" and level as "Administrator", then the page will be accessed and will be directed to the specific url. but when the account is logged in as "none" and level as "Guest", then will be directed to the login page and username and password will be entered.. the problem is the value or the innertext I am extracting has a <br /> between words, how can I set the condition like this?
[HTML]<div id="userid">Account: none <br /> Level: ADMINISTRATOR</div>[/HTML]
[HTML]<div id="userid">Account: none <br /> Level: GUEST</div>[/HTML]
[CODE]If .Document.GetElementById("userid").innertext = "Account: none " & "<br />" & "Level: ADMINISTRATOR" Then
.Navigate linktesturl
Do While .Busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
.Visible = True[/CODE]
....code continues....
I appreciate your feedback. Thank you. :)
|
|
|
|
|
You normally would not use the contents of a web page like this. You normally get the state from some state object, not the contents of the HTML.
|
|
|
|
|
well, due to limited references, this line is the one I use to identify the differences of the page status, (one with no login, and the other one with login).. Anyways, do you have an idea there which should I use in this case instead?... appreaciate your feedback. 
|
|
|
|
|
I have no idea since I don't know anything about your application, what type it is (Windows Forms, WPF, ASP.NET, ...), how it's organized, what it's supposed to be doing, ...
|
|
|
|
|
I have an application which is near complete, but I never thought it would get this big or desired. The application reads a folder with files in it for user settings, then waits for user input. When input is started, it does specific searches online. When it is doing these searches, the application appears frozen until it finds what the user was looking for and prompts the user for input.
I have tried a few ways to get threading into this, but everytime I get the problem similar to the following.
Cross-thread operation not valid: Control 'ProgressBar1' accessed from a thread other than the thread it was created on.
I tried starting a new thread within the application following http://www.codeproject.com/Articles/15861/How-to-solve-quot-Cross-thread-operation-not-valid and I still get the same problem.
How can I turn my single threaded application into a multiple threaded application?
I am using vb.net 2008
|
|
|
|
|
A thread is a new process started by u and it can not access controls of thread who create it. but the child thread can return data to parent thread.
error "Cross-thread operation not valid: Control 'ProgressBar1' accessed from a thread other than the thread it was created on" thrown by your code is an example of it.
Solution: you can use BackgroundWorker class to reduce your problem. it will start a new thread and doesn't hang your application while searching and it can also return data to your application after completion of it's execution.
if you can work according to my suggesion then OK otherwise tell me, i will give an example code that will solve your problem.
|
|
|
|
|
The Invoke pattern;
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyThread.ThatForm = Me
MyNewThread.Start()
End Sub
Public Sub SetProgress(ByVal What As String)
If InvokeRequired Then
Invoke(New Action(Of String)(AddressOf SetProgress), New Object() {What})
Return
End If
Label1.Text = What
End Sub
End Class
Module MyThread
Public ThatForm As Form1
Public Sub MyThreadExecute()
Dim i As Integer = 0
Do
i = i + 1
ThatForm.SetProgress(i)
Thread.Sleep(100)
Loop
End Sub
End Module
|
|
|
|
|
we are developing an application which accesses local and network printers. How to read list of available printers in a machine and how classify them as local and network printers.
|
|
|
|
|
There's an example in the manual[^].
|
|
|
|
|
Thanks for the update. I got the list of printers using
http://www.cpearson.com/excel/GetPrinters.aspx[^]
But i need to find network and local printers and classify them different groups. How to find local and network printers from the list?
|
|
|
|
|
KASR1 wrote: But i need to find network and local printers and classify them different groups. How to find local and network printers from the list?
You can only get a list of apparatus that are "known" by the local installation. Some TCP/IP thingy will not be recognized, until the drivers are installed.
|
|
|
|
|
Ok lets assume that i am getting five printers as follows
1. ABC
2. XYZ
3. TestPrinter1
4. TestPrinter2
5. TestPrinter3
In the above list some of them are network printers and how do i find newtwork printers programatically in VBA?
modified 27-Dec-12 7:46am.
|
|
|
|