|
Hi everybody!!!
I' wrote a function on a Visual Basic 6 application that uses an instance of Excel application (it's a hidden instance and I disabled functions that may slow down such as screen update and calculation), I need to control Excel from this application to do some specific operations. The strange thing is that the same operations i run from from my application to control excel are about 10 times slower than running them from VBA (running the same function as an Excel Macro, saved with the workbook). How is it possible??? Is there something that I missed to check???
Thanks in any case. TK
TK
|
|
|
|
|
Let me see the part of your code that you are creating the Excel application and calling some of its operations. You might be accidentally creating a new instance of you Excel app each time you make a call, or, even worse, making multiple instance of Excel. Either way would make your VB app run slow; and, if the latter, increasingly slow.
|
|
|
|
|
Hi Quacks!
Yes, you're right, I'm creating an instance of an Excel application each time I call that function but they're closed every time, so there are no multiple instance of Excel running. The machine I use is a bit slow (pentium 3 500MHz) and in fact if i run my application on a faster machine it's quite good but it's still running proportionally slow, I mean if my app runs on a slow machine, the function is done in 1 minute while in VBA in 10 seconds, and if it runs on a faster machine the function is done in 10 seconds while VBA in 1 second. This is what I can't understand.
Thanks anyway!
TK
|
|
|
|
|
I am to track what files are being copied out of my PC, whether to a floppy disks, hard disk, network drives or any other USB devices. How do I go about doing it?
|
|
|
|
|
You're really going to have a difficult time with this. Since a copy operation is really just opeing a file and reading it's contents, there is no way to tell whe is happening with the data. There are so many ways of copying a file, you can't possibly catch them all.
But, the only way to catch the opening of a file is to write a file system extension. This is NOT an easy task, requiring an in-depth knowledge of NTFS, P/Invoking Win32 API calls, marshalling various structures, ... This is something that higher-level languages, like C# and VB.NET, are not suited for. BTW: The technique I'm refering to is used by FileMon from SysInternals.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have developed app using MSCOMM32.OCX ver shipped with VB6 ( ver 6.0.8*) when ever we open com port and start accessing data CPU start hitting 100% and FAN start to spin up.
I dont understand why it happen. Is it a bug ? or what wrong with it ?
I dont do any thing fancy.
|
|
|
|
|
Pls help!
|
|
|
|
|
WShy does this have to mean there is something wrong? If I look at the sysmon, and refresh a page from CP my CPU hits a 100% also.
I would only get worried if something pegs the CPU and keeps it there continuously or for an excessively long time.
|
|
|
|
|
i need to link a pc to a mobile phone. can somebody help me out.
|
|
|
|
|
use a cable?
Seriously can you better state your question? What do you want to do? Synch? Dial from PC? Which phone, or better which OS is running the mobile?
|
|
|
|
|
|
Tell me the way to customise menus in VB6 with graphical icons and colorfull backgroud. and How to make transparent form.
Shoaib Nawaz
|
|
|
|
|
I think This Feature is not available in vb6. better u can try for any 3rd party controls.
Try for it.
bye !!
V.Gopi.
Easy Design Systems
Coimbatore
India
|
|
|
|
|
Hi everyone,
I need an algorithm/program (code) that can compute planetory position data for a given date/time/place according to Lahiri Ayanamsha (in Indian Astrlogical System). Can anyone please help me to find the same (source code/algorithm) or explain me how to find/calculate it.
Thanks in advanced,
K Amit
|
|
|
|
|
First you need to read your horoscoipe every day until it says "Today you will find the answer to that which you seek."
Then on that day, search Google for amateur astronomy sites that explain planetary position calculations.
Should not be hard to find or figure out - after all I did exactly that when I was a 12 year old kid with a telescope. All I used was a pencil, my dad's sliderule, and "The Field Guide to Astronomy".
|
|
|
|
|
Would this also work for "simple" satellites like those producing GPS information? I am looking for a position-locator algorithm for GPS satellites provided I know the Date-Time(GPS date-time), the satellites I'm reading on my GPS unit on Earth (names, signal strength), and other info I get from GPS data streams.
Thanks.
John-John
|
|
|
|
|
Planetary orbits are very stable, otherwise we would have long to live. They are also well defined. So you can calculate their positions at any given time.
GPS satellite orbits are less stable. See the link below for an overview:
http://www.pdhonline.org/courses/l116/l116content.htm[^]
|
|
|
|
|
Thanks! This looks to be a very informative article. Kepler was a genius!
Regards,
Johnny
|
|
|
|
|
In our datagrid Coding I use The Buildin function "Datagrid1.Select(i)"
If "i" may be 100 Means The 100th Row Will be selected. But I can't able to view the Particular row with in the width of datagrid. If i want to view the row mean, I want to scroll the datagrid and after It can able to saw the record.
Plz Give me suggestion or Coding for my Problem.
I am Mani I work in pondicherry
|
|
|
|
|
Dear all,
How can I change the value in a textbox into local currency format, while inputting?
Thankx
|
|
|
|
|
use format function while the has lost its focus
ex : Txtamount.Text = format(txtamout.txt,"Currency")
OK !!!
V.Gopi.
Easy Design Systems
Coimbatore
India
|
|
|
|
|
No i want the text changed as i input in the textbox, not after lost focus
thanx
|
|
|
|
|
Dear all
I would like some help about one problem . the problem is I want to create a set of strings .this is the example :
there is a string "some" and I want to create new strings that have the same length (the new string also have 4 charaters) but the condition is
the charater "s" can become to charater "a" and "c"
the charater "m" become to charater "k" ,"l" and "u"
the charater "e" can become to charater "b" and "h" .
so the result is we will get the following strings :
1 some 10 soue 19 aole 28 coke
2 somb 11 soub 20 aolb 29 cokb
3 somh 12 souh 21 aolh 30 cokh
4 soke 13 aome 22 aoue 31 cole
5 sokb 14 aomb 23 aoub 32 colb
6 sokh 15 aomh 24 aouh 33 colh
7 sole 16 aoke 25 come 34 coue
8 solb 17 aokb 26 comb 35 coub
9 solh 18 aokh 27 comh 36 couh
I create a function in vb6 but I just can create only 29 strings
so I need some help about this
Please help me on this by create some code in vb6 .
I hope I can get the answer from everyone in this 2 or days !
Thanks !!!!!
Regards,
Ly bun
|
|
|
|
|
If you post the code you are using, maybe we can help.
...Steve
|
|
|
|
|
I have rewritten your code to use a recursive Sub rather than a Function. The main problem with your examle is that you were not inspecting all possible combinations of the input string (i.e. only one iteration of the For...Next loop was ever executed). It can be refined further but this will do for a brief explanation.
This example also uses a Scripting.Dictionary object rather than an array because it simplifies the detection of duplicate strings (I assumed that duplicates were not permitted). Look this up in the VB help files for more information.
Option Explicit
Private Sub GenerateStrings()
Dim wd As Scripting.Dictionary
Set wd = New Scripting.Dictionary
Call test2("some", wd)
'Command1.Caption = wd.Count
End Sub
Sub test2(str As String, ByRef wd As Scripting.Dictionary)
Dim ch As String
Dim ch1 As String
Dim ch2 As String
Dim wlen As Integer
Dim i As Integer
wlen = Len(str)
For i = 1 To wlen
ch1 = Left(str, i - 1)
ch = Mid(str, i, 1)
ch2 = Mid(str, i + 1, wlen)
Select Case ch
Case "s"
Call test2(ch1 & "a" & ch2, wd)
Call test2(ch1 & "c" & ch2, wd)
Case "m"
Call test2(ch1 & "k" & ch2, wd)
Call test2(ch1 & "l" & ch2, wd)
Call test2(ch1 & "u" & ch2, wd)
Case "e"
Call test2(ch1 & "b" & ch2, wd)
Call test2(ch1 & "h" & ch2, wd)
Case Else
End Select
Next
If Not wd.exists(str) Then
Debug.Print str
wd.Add str, str
End If
End Sub
'Function test1(str As String) As String()
' Dim wd() As String, ch As String, ch1 As String, ch2 As String
' Dim wlen As Integer, i As Integer, j As Integer
' j = 0
' wlen = Len(str)
' For i = 1 To wlen
' ch1 = Left(str, i - 1)
' ch = Mid(str, i, 1)
' ch2 = Mid(str, i + 1, wlen)
'
' If ch = "s" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "a" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "c" & ch2
' j = j + 1
' End If
' If ch = "a" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "s" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "c" & ch2
' j = j + 1
' End If
' If ch = "c" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "s" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "a" & ch2
' j = j + 1
' End If
'
' If ch = "m" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "k" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "l" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "u" & ch2
' j = j + 1
' End If
' If ch = "k" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "m" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "l" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "u" & ch2
' j = j + 1
' End If
' If ch = "l" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "k" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "m" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "u" & ch2
' j = j + 1
' End If
' If ch = "u" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "k" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "l" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "m" & ch2
' j = j + 1
' End If
' If ch = "e" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "b" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "h" & ch2
' j = j + 1
' End If
' If ch = "b" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "e" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "h" & ch2
' j = j + 1
' End If
' If ch = "h" Then
' ReDim Preserve wd(j)
' wd(j) = ch1 & "e" & ch2
' j = j + 1
' ReDim Preserve wd(j)
' wd(j) = ch1 & "b" & ch2
' j = j + 1
' End If
'
' Next
' test1 = wd
'End Function
'
...Steve
|
|
|
|