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




Through VB - Runs Great, Compiled - Runs Like Crap


I just finished a program I've worked on for a couple of days.

While in VB, running the software and testing it, and all that went faster than I could have dreamed.

Now when I compiled it, then ran the program it runs like a horse stuck nose deep in it's own filth. (Seriously, it's TERRIBLE)

Is this normal? What can I do to fix this other than find faster ways to write my code?

I've tried changing the Optimization settings for compiling to Fast Code, Small Code and No Optimization, and they all seem to run about the same.

Any ideas?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Project RUns Great In IDE, Illegal Op. In Compiled. Problems With OLEAUT32.dll!!
First of all thanks for any help in advance cause this is driving me crazy.

I have win98 and im writing a program with 2 forms, a setup screen form, and then an invisible form that performs all the operations and is unloaded and reloaded anytime the setup screen is changed.
Everything works GREAT in the IDE however when i run the **** compiled version, when i go to the setup screeen and hit apply, which in the code, is where the Unload Form2 Load form2 thing happens and i get an "Illegal Opeartion, ..etc" in OLEAU32.dll or whatever the **** thing is called, very frustrating, it even does it when ever i change the visibility of a form such as form2.visible = true etc. but like i said it works great in the ide, its the compiled version thats craptacular. thanks peoples.!
Nick

My Compiled EXE Runs In VB6 Folder But Nowhere Else
Ok I got a feeling I have missed something very important while teaching myself VB6 (through reading). I compile my EXE file and it runs great while in the VB6 folder. But when I move it somewhere else or onto another computer (that doesn't have VB6) and try to run it weird things happen (forms don't show, labels can't be seen etc). I assume there is some required file that needs to be in the same folder as the EXE in order for it to be run correctly? And this file is in the vb6 dir? I am assuming, am I right? What file is this? So do I have to include this file with any program I make? What about copyright stuff, microsoft ain't gonna come knockin at my door with papers cause I sold my own program which contained their file that is *required* to make it run corrently right? PLEASE help, sorry about all those questions.. :-)

-Wolfy

Dll Runs Fine When Compiled Using Win2k, But Not XP.
Hello,

Here is my situation. We have a bunch of dll's we use on a win2k server. I am testing to see if the same code can be compiled on an XP machine and used on that same win2k server. It does not seem to work. I haven't changed any of the code at all. Just compiled it in XP. I have the following dependencies.

Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
COM+ Services Type Library
Microsoft Message Queue 3.0 Library
ADO 2.5
Microsoft XML, version 2.0
Microsoft Scripting Runtime

Thanks for the help!

Help! Vbp Runs, But Compiled Version Doesn't
When I use F5 to run my application, it works fine, but when I compile it and it is called, I get the error "'Orientation' Property cannot be changed within a page."

The app is used in a DOS program to print reports. I have it working on another machine, and was once working on mine, but now I get the error when I compile and install it. Any suggestions??

Here is the app:



private Sub Form_Load()
Open "Printpdp.doc" for input Access Read as #2

Dim MyFont as new StdFont

With MyFont
.Bold = false
.Name = "courier"
End With
set Printer.Font = MyFont
Restart:
Line input #2, A$
If EOF(2) then
Close #2
Kill ("Printpdp.doc")
End
End If

D% = InStr(A$, Chr(12))
If D% > 0 then
mid(A$, D%, 1) = " "
Printer.NewPage
Page% = 1
End If

C% = InStr(A$, "&k2S")
If C% > 0 then
mid$(A$, C%, 4) = " "
Printer.FontSize = 8.5
If FirstTime% = 1 And Page% <> 1 then
Printer.NewPage
End If
FirstTime% = 1
End If

B% = InStr(A$, "&l1O")
If B% > 0 then
mid(A$, B%, 4) = " "
Printer.Orientation = vbPRORLandscape
End If

C% = InStr(A$, "&k0S")
If C% > 0 then
mid$(A$, C%, 4) = " "
Printer.FontSize = 10
End If

B% = InStr(A$, "&l0O")
If B% > 0 then
mid(A$, B%, 4) = " "
Printer.Orientation = vbPRORPortrait
End If



Printer.print A$
Page% = 0
GoTo Restart
End Sub

Problem - Compiled Program Only Runs On WIN98
I made a VB6 program, then compiled it and tested it on different computers and systems. The program works great, contains no bugs, but.... I only runs well on Win-98! On Win-2000 or Win-XP it sometimes even doesn't want to start or sometimes it starts, but stops later.

When it stops or doesn't start, the Run-time error '7' + 'Out of memory' is reported. As said, under Win-98 there is no error.

I suppose there is some library problem, but have no idea, how to solve it. The program is using 'Commondialog', 'flexgrid' and other advanced elements, so I did add the needed OCX-files to the program folder.

Can anybody give me any useful information?

Thanks!
Matej

Runs Fine In IDE, Subscript Out Of Ranges After Compiled
What does this mean? Anyone ever seen anything like it?
I can run my program from VB just fine, once I compile to exe and run it errors. :s

App Runs Fine In Debug.. Freezes When Compiled - What Do I Do?
Any suggestions? how can i figure out where its going wrong?

Problem - Compiled Program Only Runs On WIN98
I made a VB6 program, then compiled it and tested it on different computers and systems. The program works great, contains no bugs, but.... I only runs well on Win-98! On Win-2000 or Win-XP in sometimes even doesn't want to start or sometimes it starts, but stops later.

When it stops the Run-time error '7' + 'Out of memory' is reported. As said, under Win-98 there is no error.

I suppose there is samo library problem, but have no idea, how to solve it. The program is using 'Commondialog', 'flexgrid' and other advanced elements, so I did add all the needen OCX-files to the program itself.

Can anybody give me any useful information?

Thanks!
Matej

Installer Runs Each Time My Program Runs
Hi All

I have a vb6 program (front end to an Access database) which I have distributed to eight users running Windows 2000 SR2.

The Windows Installer (created with Visual Studio Installer) installed correctly on all eight computers.

For some reason on three of these computers the installer runs whenever the program is run (at least after the computer is restarted)

Any suggestions would be greatly appreciated



HalinaOz

PROGRAM When Played RUNS PERFECT...but When Compiled I Get A 55-error File Already Open?
My program works perfectly when ran before compiling.... but when it's compiled and I try to close the program I have some code in the form terminte that deals with two files, that are delt with in the form load.... in the load section they are closed... in the terminate section the are closed as well...

and ideas?

Justin

Vb Runs > Office Installer Runs!
Whenever I run VB6 enterprise edition the Microsoft Office XP Pro with FrontPage Installer comes up and I have to cancel three or four times! I don't have my Office disk with me at the moment, can I stop this from happening? Or, do I have to let the installer run (I can get my cd) once?

Thanks

Why It Runs First...
I need an explanation from someone. Take a look at this code...


Code:
Dim SQL As String
Dim StatSQL As String
Dim InvEntSQL As String
Dim BrkDwnSQL As String
Dim Customer As String

StatSQL = "SELECT * FROM SalesUpdate WHERE Code = '1'"
Set DataStatRS = New ADODB.Recordset
DataStatRS.Open StatSQL, DB

If DataStatRS!Updated = Date Then
Set ItemX = ListView1.ListItems.Add(, , "Checking for new records from LIORDER database...")
SQL = "DELETE FROM InvoicesEntered WHERE InvDate = CONVERT(CHAR(10),GETDATE(),101)"
DB.Execute SQL

SQL = "INSERT INTO InvoicesEntered (JPO, CustNo, Pos, InvNo, InvDate, Disc, CalcMode, Total, Gl1, Sp1, Gl2, Sp2, Gl3, CostCtr) " & _
"SELECT x.auf_nr as OrdNo, z.kunr CustNo, x.auf_pos as Pos,x.rg_nr as InvNo,x.rg_dat as InvDate, z.kopf_abschl as Disc, " & _
"y.ver_art as CalcMode, sum(y.sum_netto*x.rg_anz) as TotSQM, y.glas1 as Gl1, y.lzr1 as Sp1, y.glas2 as Gl2, y.lzr2 as Sp2, " & _
"y.glas3 as Gl3, y.pos_kostenst as CostCtr " & _
"FROM liorder..LIORDER.AUF_STAT x, liorder..LIORDER.AUF_POS y, liorder..LIORDER.AUF_KOPF z " & _
"WHERE z.auf_off = 0 and z.auf_nr = x.auf_nr and z.auf_nr = y.auf_nr and x.auf_pos = y.auf_pos and x.rg_dat = CONVERT(CHAR(10),GETDATE(),101) " & _
"GROUP BY x.auf_nr, x.auf_pos, x.rg_nr, x.rg_dat, y.glas1, y.glas2, y.glas3, z.kunr,z.kopf_abschl, y.lzr1,y. lzr2, y.ver_art, y.pos_kostenst"
DB.CommandTimeout = 0
DB.Execute SQL

DoEvents

ItemX.SubItems(1) = "Done!"

Set ItemX = Nothing
StatSQL = ""
DataStatRS.Close
Set DataStatRS = Nothing
Else
If DataStatRS!Updated <> Date Then
Set ItemX = ListView1.ListItems.Add(, , "Last update received from LIORDER database was " & DataStatRS!Updated)
Set ItemX = Nothing
Set ItemX = ListView1.ListItems.Add(, , "Checking for new records from LIORDER database STEP 1...")
SQL = "DELETE FROM InvoicesEntered WHERE InvDate = '" & DataStatRS!Updated & "'"
DB.Execute SQL

SQL = ""

SQL = "INSERT INTO InvoicesEntered (JPO, CustNo, Pos, InvNo, InvDate, Disc, CalcMode, Total, Gl1, Sp1, Gl2, Sp2, Gl3, CostCtr) " & _
"SELECT x.auf_nr as OrdNo, z.kunr CustNo, x.auf_pos as Pos,x.rg_nr as InvNo,x.rg_dat as InvDate, z.kopf_abschl as Disc, " & _
"y.ver_art as CalcMode, sum(y.sum_netto*x.rg_anz) as TotSQM, y.glas1 as Gl1, y.lzr1 as Sp1, y.glas2 as Gl2, y.lzr2 as Sp2, " & _
"y.glas3 as Gl3, y.pos_kostenst as CostCtr " & _
"FROM liorder..LIORDER.AUF_STAT x, liorder..LIORDER.AUF_POS y, liorder..LIORDER.AUF_KOPF z " & _
"WHERE z.auf_off = 0 and z.auf_nr = x.auf_nr and z.auf_nr = y.auf_nr and x.auf_pos = y.auf_pos and x.rg_dat >= '" & DataStatRS!Updated & _
"' GROUP BY x.auf_nr, x.auf_pos, x.rg_nr, x.rg_dat, y.glas1, y.glas2, y.glas3, z.kunr,z.kopf_abschl, y.lzr1,y. lzr2, y.ver_art, y.pos_kostenst"
DB.CommandTimeout = 0
DB.Execute SQL

DoEvents

SQL = ""

SQL = "UPDATE SalesUpdate SET Updated = CONVERT(CHAR(10),GETDATE(),101) WHERE CODE = '1'"
DB.Execute SQL

ItemX.SubItems(1) = "Done!"

Set ItemX = Nothing
SQL = ""
StatSQL = ""
DataStatRS.Close
Set DataStatRS = Nothing
End If
End If

...I've made this procedure for inserting records. I placed it in a form with just a listview in it to notify users of what's going on and to prevent them from thinking that my application hanged. I'm calling this procedure at form load. But the problem is, even before the first message is displayed on the listview, it already starts executing the SQL statement. The SQL statement itself takes time to finish execution because it's pulling records from a linked Oracle DB and insert it on our SQL Server. That's why I'm placing a message on the listview to inform users of it's current state. But that's basically the problem. Eveytime the form loads, it immediately executes the SQL command preventing the form to show up. I'm puzzled as to why this happens 'coz as far as I know, VB codes are executed line by line. Can somebody please shed me some light on this matter...?

Runs In IDE But Not EXE
I have searched for hours on the internet and have found lots of questions but not ONE answer. In every forum this question goes unanswered, even in the Microsoft Forums. They completely ignore it. I have seen just about ever guess there is and they are all just that GUESSES!!!

Error 12029 - Inet Control
Error 10061 - Winsock

As well as other assorted related errors. I even downloaded code sample projects from the Microsoft site on correct programming for these controls and still those projects don't work outside the IDE. Go Figure...

Take a look and let me know what you think...

Run It When Another One Runs! :D
I want to know how I can like startup my exe when for example when notepad is started. Is it possible to write that in the registry? Sounds pretty simple but it isn't I guess since nobody answered my last thread. So when an app runs your app has to run also? Any idea??????
It doesn't necessarily have to be the code. Maybe just the registry keys or something? It's used on a win9x system if it would matter.
Thx in advance!

DTS Runs In Wiz, But Not Run From VB6
I have written a DTS export to export data to Excel and it runs perfectly from the wizard, however when I save it as a vb file and try to run it, I only get the headings of the file but do not get any data in the Excel file. What could I be doing wrong?

Thanx for all the help

Only Runs Local
Hi all

I made a program ( VB and Access) and instalation disk using windows 2000 Pro.
With computers using XP, NT or Server it works trough net, but if the user has 98 in his machine doesnt work by net, only local.
It gives, "error 3044, isnt a valida path". Any idea what to do?

Thank you.

App Runs In XP But Not In VISTA
Hello all,

I have an app wich runs fine on xp, but I dont know why it has a problem on Vista. I was able to install the app but it has a routine to import data from other mdb, and it doenst import, but doesnt give any message or any mistake just simply doesnt import.

Anyone faced something lie this or have any idea what can I do?

Thank you

Application Runs Twice (Why?)
This Application runs twice after I compile and run the EXE. In the VB Enviornment I works fine.

I tries to use a flag so that it only runs once but that didn't work.

Private Sub Form_Load()
Dim dblOne As String
Dim dblTwo As String
Dim flag As Integer
flag = 0

Form1.Hide

If Len(Dir$("c:key file.txt")) Then

Form1.Show
Else

MAPISession1.LogonUI = True


SendKeys "~", False


MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID

MAPIMessages1.Compose
MAPIMessages1.RecipAddress = "jason.fisher@semcoenergy.com"
MAPIMessages1.ResolveName
MAPIMessages1.RecipDisplayName = "jaydog"

MAPIMessages1.MsgSubject = "Map Finder Express"
MAPIMessages1.MsgNoteText = "New User"


If MAPIMessages1.MsgIndex = -1 And flag = 0 Then
dblOne = "key"
dblTwo = "file"
Open "c:" & "key file.txt" For Output As #1
Write #1, dblOne, dblTwo
Close #1
flag = 1
Form1.Show
End If
MAPIMessages1.Send False
MAPISession1.SignOff

End If
End Sub

Load_Form Sub Runs Twice
Any reason why my load_Form sub runs twice when my app is first run. I have search through my code but cant seem to find a reason why it is.

This is module...

Code:
Public fMainForm As frmMain

Sub Main()
Set fMainForm = New frmMain
fMainForm.Show
End Sub

This is Load_Form sub...
I added the if statement trying to locate where it is running again.
I added MainFormLoaded to test when it was running the second time. but it runs twice at the same moment because both times clears the if statement and the debug.print shows "Load Form: false" both times.

Code:
Public MainFormLoaded as Boolean

Private Sub Form_Load()
If MainFormLoaded = False Then
Debug.Print "Load Form: " & MainFormLoaded
MainFormLoaded = True
Call Load_MainForm
End If
End Sub

It's probably an easy answer to a stupid question.
any ideas?

Application Runs Twice (why?)
This Application runs twice after I compile and run the EXE. In the VB Enviornment I works fine.

I tries to use a flag so that it only runs once but that didn't work.

Private Sub Form_Load()
Dim dblOne As String
Dim dblTwo As String
Dim flag As Integer
flag = 0

Form1.Hide

If Len(Dir$("c:key file.txt")) Then

Form1.Show
Else

MAPISession1.LogonUI = True


SendKeys "~", False


MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID

MAPIMessages1.Compose
MAPIMessages1.RecipAddress = "jason.fisher@semcoenergy.com"
MAPIMessages1.ResolveName
MAPIMessages1.RecipDisplayName = "jaydog"

MAPIMessages1.MsgSubject = "Map Finder Express"
MAPIMessages1.MsgNoteText = "New User"


If MAPIMessages1.MsgIndex = -1 And flag = 0 Then
dblOne = "key"
dblTwo = "file"
Open "c:" & "key file.txt" For Output As #1
Write #1, dblOne, dblTwo
Close #1
flag = 1
Form1.Show
End If
MAPIMessages1.Send False
MAPISession1.SignOff

End If
End Sub

App Runs In Vb Environment But Not As An Exe
Ive written an app in vb6, in runs perfectly in the vb environment, but when i compile it i get the following error:
Run-time error '5':
Invalid procedure call or argument

this error occurs after a call to a C dll. The dll gets initialised, it retrieves the data it is supposed to from the com port, but when it sends a return code to my vb app, the error occurs.

It runs perfectly in VB. Does anyone have any idea why this happens?

Thanks for your time

ActiveX Runs Only Once
My application communicates with some electronic equipment via ethernet. The suppliers of the equipment have supplied an activeX component to communicate with their equipment. I am running my app (with their activeX component) uncompiled. The first time I run it it works perfectly. If I end the program and then start it again, it does not connect. To get it to work again, I have to shut down VB and restart VB, open the project and then run it.
Can anyone explain this ?

Program Only Runs Through Once
i've written a program that messes up if you try and run it more than once. is there anyway of reseting the project at the end of the program to restore its initial values so that it will run agian. thanks a lot.

Runs In IDE, Crashes In EXE ???
Program using the GOGO.dll to create real time mp3 encoder. Program runs fine in the IDE, however once compiled into an EXE, it crashes the VB Runtime dll. How come it runs in IDE & not windows?

Source Code:
http://www.planet-source-code.com/vb...46825&lngWId=1

Required GOGO DLL:
http://orbita.starmedia.com/gogolive/

I need to get this original source code working, as I'm using the encoding portion in another project.

Any suggestions will be greatly appreciated!!!

Run An EXE Before Setup Runs
Hello all,
I have create a SETUP.EXE using InstalledSheid X Express for my S/W
I want that when a user open Setup.EXE or double Click on Setup.EXE, another Exe file runs before setup process.
Is it possible ?
Please help me

App Runs When Pc Is Turned On
Can any 1 tell me how to get an app i have writen to run automatically when the PC it is loaded on is started. Also can this be done for multiple applications??

This is probably so easy I look a fool but I just can't find a way to do it

Cheers

Vba Application Runs In Win'95 But Not In Win'98
Vba third party application running fine in windows 95 but giving error message 'VBA RUNTIME ERROR 1004' when we tried on win'98 machine. Vendor documentation says it works for both 95 and 98. Any help ?

Ftp Runs But No Transfer
i run this program but no transfer nothing
whats wrong, i have ftb server



Inet1.Protocol = icFTP
Inet1.URL = "147.10.10.1" 'Text1.Text
Inet1.UserName = Text2.Text
Inet1.Password = Text3.Text
Inet1.Execute , "PUT " & "c:qbasicace.txt" & "\147.10.10.1acepta.txt"

MsgBox "Transfer Complete"

Exe Which Runs In Any Platform????
is it possible to create an exe in vb which can run in any platform ???

Vbp File Runs Ok Exe Does Not
Hi,
The database sits on the server (Windows 2003 configured as a terminal server whatever that means). I have a vb6 program which works with that database. When I run this program theough the VB interface all goes fine. I made an exe file and put it on the server. Now when I run the program through the exe file I get an error. The error is from microsoft saying that an error report has been created do you want to send it.

can anyone please help me in this regard. I dont know if I should be posting this in the OS forum.

Thanks in advance.

Application Runs On Win NT But Not On Win 95..
I have developed a application in which I have used Microsoft CommonDialog Control 6.0 for Open File Dialog. The application is developed on Win NT machine.

The application runs fine on Win NT and Win 2000 machine. However, on Win 95 it gives an error for Comdlg32.ocx (says outdated control). When I overwrite the Comdlg32.ocx in win 95 machine with that on Win NT machine application works fine.

I believe it may not be safe to overwrite OCX files as they may be used by other applications.

How do I develop a application which runs both on Win 95 and Win NT?

Thanks in advance..


Which Form Runs First
pretty noobie question:

i have an app w/ a few forms in it. how can i change which form opens 1st on a run?

LOL...never saw that Project>Properties menu!

sorry i can't delete this post
uh uh... great forum!

[sellhell]

Edited by - sellhell on 9/18/2004 9:59:09 PM

Need Help On : Find If An App Runs...
Hi all !

I am currently coding a new app that got an app status in it...
Im gona make a timer that every seconds will look if the app is running...
If the app is running the a label will show Running...
And if not it will show Stand By...

I know how to code it all except how to look if the app is running...

I think i have to work with hwnd but don't know how...

If someone can help me it will be appreciated...

Thx a lot !


~Dezo Loco.

VB EXE Does Not Work, But Runs From VB6 IDE
Hello,
I need help with this please, Can't figure out what to do as it does not give me any error number or anything.just does not work.
My Application runs fine in IDE but once I create the EXE file and click on Find option which opens a FindForm, It finds the record but will not display on the main form Except that it always displays the First Record

and after that in my main form if I click on Next/First or any navigation button, it will not update the Label which displays Record Position like (2 of 10)

Thanks in Advance....


-DD12

Vb Control That Runs On A Mac?
I have a vb control on a Web page that downloads to the client's machine after accessing. Need to make this control run on a Mac. Is this possible?

solanjie
mailto:Solanjie@yahoo.com

Application Runs On Win NT But Not On Win 95..
I have developed a application in which I have used Microsoft CommonDialog Control 6.0 for Open File Dialog. The application is developed on Win NT machine.

The application runs fine on Win NT and Win 2000 machine. However, on Win 95 it gives an error for Comdlg32.ocx (says outdated control). When I overwrite the Comdlg32.ocx in win 95 machine with that on Win NT machine application works fine.

I believe it may not be safe to overwrite OCX files as they may be used by other applications.

How do I develop a application which runs both on Win 95 and Win NT?

Thanks in advance..

How Do I Know The First Time A Program Runs??
Hi,

I am using SaveSetting and GetSetting in my VB code. The trouble is, the first time the program runs, no setting has been saved and I get a runtime error! How can I find out the first time the program is run so as I can use a default value for SaveSetting??

Thanks,

Blaaboy

Vb6 Program Runs On Win98 But Not On Win Xp
Hi all.

I have a small vb6 program running on win98 but when I tried to run it on a win xp machine, the screen turn grey, or buttons and menu dont have any text. It occurs after a few minutes of inactivity.

Any idea what might be wrong?

Thanks.



pd:I expect you understand my english.

Screensaver Runs Minimized
Hi ,
thanks for your time...
I am trying to create a screen saver in VB. I have set the options

BorderStyle None
Caption ""
ControlBox False
Icon None
ShowInTaskBar False
WindowState Maximized

My code is as follows

Code:
Private Sub Form_Load()
If App.PrevInstance Then
End
End If
Me.Width = Screen.Width
Me.Height = Screen.Height
Picture1.Width = Me.Width
Picture1.Height = Me.Height
imnum = 1
' Timer1.Enabled = True
' Timer1.Interval = 4000
Form1.Show

End Sub
I also give title as SCRNSAVE: in project->properties->Make->title...

I save it in system32 (platform: win2000).

The screen saver appears minimized and just above the taskbar

Any suggestions would be appreciated. Thanks again,
Regards,
M

VBA Runs Faster Second Time
I'm writing a vba script to extract data from MS Project. The first time I run the script it is extremely slow.

The second time I run it it is very, very fast. If I change data it is still fast. If I reboot the computer and re-run it it is very fast. However, if I open a new file or add tasks to the existing file the script runs slow.

Any thoughts on how I can get it to run fast the first time?

smv

Script Runs In Loops
HI,

I'v created templates with a userform in the first -protected- section.
I've inserted a macro 'update' which updates the userform, the document fields and the TOC.
I've put in three sections myself of which only the first is protected using the following script (part of the "update-macro":
Rem Protect section 1 from editing
ActiveDocument.Sections(1).ProtectedForForms = True
ActiveDocument.Sections(2).ProtectedForForms = False
ActiveDocument.Sections(3).ProtectedForForms = False
ActiveDocument.Protect Password:="projectbureau", NoReset:=False, Type:= _
wdAllowOnlyFormFields

Now the problem is, that whenever someone adds sections on their own, the update macro runs in loops and crashed the application.
Anyone know how to fix this?

Thanx
Anne

When Excel VBA Runs Slow
I am posting this separately to pass on a useful finding.

After editing Excel VBA code the macros (subs and functions) often, if not always, run much slower. Sometimes painfully slow.

After searching this issue quite a bit I found somewhat hidden comments in this regard.

The trick is, after an editing session, to "save-as" the workbook to a new file. Then, if you want, delete the old file, rename the new file to the old name, and voila, the code runs as fast as it ever will run. (No comments on execution times intended). The "save-as" re-writes the code area cleanly, where as the "save" only saves the messy edited space.

This works equally well with .xla (Add-Ins).

Hope this helps speed things up a bit,
kdsdata

Calculation Runs When I Dont Want It To!
Hi
I have an error-handler in the lost_focus event of a text box called txtParas. If the figure is out of bounds (in this case 1000 or more) I want the focus put back in this box again. This does happen, but for some reason another calculation (which is written to the next text box called txtMags, and is in that text box's lost_focus event also) gets performed. I only want that calculation performed when the figure in txtParas is acceptable!

This traps the error, and is in txtParas.text_LostFocus:

Code:
Select Case theunit
Case "mas"
spcs = Val(txtParas.Text) / 1000
If Val(txtParas.Text) >= 1000 Then
MsgBox (must), vbExclamation, (wrong)
txtParas.SelStart = 0
txtParas.SelLength = Len(txtParas.Text)
txtParas.SetFocus
Exit Sub
End If
...other cases here...
end select
end sub
But even though it breaks out of the sub and shows the message box correctly, the calculation in the next text box is still performed, even though focus is back with txtParas. Why is the other code in txtMags being run, even though its in txtMags' lost_focus event, and we haven't even been there yet?
Help! I know it's got to be something simple...

What To Do When A List Runs Out Of Space?
hi:

i have a ListBox (list1) on my Form.
if i add lots of items, a vertical scroll opens, however, if i write
a very long line into the list, no horizontal scroll opens!

what can i do?

thanks!

Making Sure A Process Still Runs
I had a post on this last week and I though I got it running but I am still having trouble keeping my custom control running when the machine is off doing somthing else.

I build this control that displays a different image in a loop once every 60 ms. I am using this to display to the user that our software is still working and that the machine has not frozen.

Here is the way I would like it to work:
I start the control, start and complete a serverside read, do a crystal reports display and the then stop the control. The whole time the control keeps switching images.

Here is what happens:
I start the control and it goes into its "Thinking Display" but then haults for the serverside read and fianlly starts back up after crystal starts to display data.

Is there anyway I can for the program to make sure it goes back and displays a new image when it is supposed to. I realize this will compromise the speed but I will still like to know if it is possible.

Thanks,
Derrick

'<>
Private thinking As Boolean
Private imageNumber As Integer
Dim forward As Boolean

Public Sub Think(Thinker As Boolean)
thinking = Thinker
Timer1.Interval = 200
Timer1.Enabled = True
forward = True
imageNumber = 11
Call Timer1_Timer
End Sub

Private Sub Timer1_Timer()

If thinking = True Then

If imageNumber = 25 Then
forward = False
imageNumber = 24
ElseIf imageNumber = 2 And forward = False Then
forward = True
imageNumber = 1
ElseIf forward = True Then
imageNumber = imageNumber + 1
ElseIf forward = False Then
imageNumber = imageNumber - 1
End If
Picture1.Picture = ImageList1.ListImages.Item(imageNumber).Picture

Else
Picture1.Picture = ImageList1.ListImages.Item(29).Picture
End If

End Sub

Private Sub UserControl_Initialize()
Picture1.Picture = ImageList1.ListImages.Item(29).Picture
End Sub

Private Sub UserControl_Resize()
Height = 1.14 * Width
Picture1.Height = 1.14 * Width
Picture1.Width = Width
End Sub
'</>

Timer Runs While DUN Dialing
I am currently using the Timer to implement a set of instructions to be ran once every 5 secs, however depending on the occurence of certain events, I am required to perform certain actions.....

One of which is to perform a dial-up.... by making use of Dial-Up Networking (DUN).

I'm using the WinInet API to perform that.

However, once I run DUN, the instructions, which was implemented under the Timer function cease operation..

May I asked if there's anyway to make the Timer continue it's operation even when I'm performing the DUN??

Any sorta of advice and contribution will be greatly appreciated..

Thanks......

Pressing Enter Runs A Sub
hi

i have a textbox and some combo-boxes, i would like to be able to press ENTER and have a certain sub procedure run - how do i do this?

thx

Program Runs Too Fast!!!
I use an SQL statement to fill a table then There is a report created in data environment which takes data from the table to populate the report.

My problem is that when I trace it step by step in my coding, it populate my report correctly, but when I run it directly without tracing, I get an empty report.

Is it that my program runs too fast!

How To Detect When The Program First Runs?
Dear all,
I am currently creating a program in Visual Basic 6 where I need to be able to detect whether it is the first time the program has been run on that PC. In the short amount of experience I have gained with using VB, something tells me there has to be some kind of built in function, that at least returns the amount of times the program has been run. Then I could use a basic If Statement.

Any suggestions from anyone would be very much appreciated.

Thank you all for your time,

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