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




Stop Screen Update During Macro Execution


My macro runs slow because it updates the screen as it processes each line of the spreadsheet. I believe there is a way of inhibiting screen update during macro execution.(?)




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Code Execution
Hi,

I was wondering if the following was possible:
Imagine the following procedure calls:
http://www27.brinkster.com/countoia/images/avp13002.gif

In procedure C, an event "HasError" is triggered
I display the Error message with a messagebox and then I want the code execution to stop
(no execution of all following code in all parent procedures)

Is this possible? How do I do it?

Thanks!

OsMo

How Do I Stop A Procedure In Execution?
how do you stop a procedure from execution? i'm writing a long code in a mousemove event, w/c means the codes get called repeatedly in rapid succession. what if the previous instance of the mousemove procedure has not finished executing yet, how will i stop the previous execution to prioritize its newer instance?

Sample: try to place a loop executing 1,000,000 times inside a mousemove event then play with the mouse...

Stop Execution Of Command
I developed a simple VB program.
Lets say I want to stop manually the execution of the command launched in the past, which is still running?
How can I solve the problem? I don't want to close the whole application, only the command which is running.

Force Execution Of An Exe To Stop
Can i force an exe that runs in background, to stop executing ?

(Almost similar to the working of "End Process" in the Task Manager of Windows 2000)

Note : I know the process id (pid) of the exe , whose execution I want to stop.

Is there anyone who can help me?

How Do I Get The Execution Of Code To Stop...
I want to give the user the ability to enter email subject line and email body text before my code completes the email. I get the 2 form to show but the code still executes so my email goes without get the subject and body text.

How do I pause the code until the user clicks the OK button on each form?

Stop Execution In VB With Shortcut-key
Everybody knows these do-loops where the counter is missing at the end; the ADORecordSet-Movenext-Method is missing and so on. No breakpoint in the code so the application runs and runs. The only way I found is to kill the Application (in the end then VB6) in the Task Manager of Windows. If the code wasn't saved hard work is gone.

But someone told me that there is a hidden shortcut-key how I can tell VB to stop execution or end the programmed application.
Does anyone know what shortcut-key this is ?

Stop Execution Of Code In Class
Hello!

Is it possible to stop the code execution in a class? If so, how? I tried declaring a variable in the class and creating an additional function called "StopExecution" which sets the variable to False and then in the "main" function check if the variable is still True and if not, exit. However, that is useless since StopExecution can be called only after the "main" function terminated.

Regards,
Sebastian

How To Stop Execution Of Application For Certain Time?
Hiii Everyone,

In my application i am using "ShellExecute" win 32 api to execute .exe files in Vb 6.0. .Exe file is generates One Text file and my application will read that file for further processing. What i need is i have to stop execution of my application untill .Exe file is executed succefully and the text file generated b7y it is available for further execution of my application.

I tried to use simple Loop to stop it untill one variable become true or false. But it seems to be not permenent solution.even i tried with "Sleep" wine 32 api to stop execution for few seconds. But some time. But it also fails as execution time of .exe file is not fixed.

What is solution for this? is there any other api i can use? Or any other solition to my problem?

Please atleast give some input...

Thanks in advance ...

Hdave

VB Debugger Doesn't Stop Execution After I Quit Application
Greetings all

I've developed an application in Visual Basic 6.0 that uses Word and Excel to produce reports. My present problem is that whenever I run any code related to Word or Excel, afterwards the application will not quit properly. That is, for instance, when I run it still in development (through the IDE) and when I quit, the debugger wont stop the execution (I have to force it with the "stop" button). When running the compiled exe in a standalone way, the application quits (window dissapears) but the process is still running (as confirmed through task manager).

This only happens when I use Word/Excel related code through related application functionalities. Is this a common problem? Did I miss freeing any resources? I've been careful with freeing all the references to Word/Excel (set obj = nothing) and using getObject() to pick the running process, instead of creating a new one.

What do you think is missing? Could you help me please?
I'm kind of running out of options.

Thanks

Griblitz

Stop Code Execution Until Boolean Variable Is True
Hello!

Is it possible to stop code execution in my program until a variable becomes true in such a way, that the application does not consume 100% of the CPU like it happens with Do ... Loop loops?

Regards,
Sebastian

How To Stop Execution Of Procedure, And Wiat For User To Enter Value In Textbox?
Helloooo!!!


In my application, at runtime i am loading form from Module. I want to stop execution my procedure in modelu, until user enter value in Textbox of opendform and close that form.

I am trying to use WaitForSingleObject DLL to do this. But somehow i am not getting my procedure to stop unitll user entered value in textbox.

Is it possible to do this with "WaitForSingleObject"? If yes, then do i need to create object of Form?

I am using Load Mehtod to load form runtime.

Help, Anybody? I am stuck.

HDave

Permanent Macro Execution Possible?
Hello, everybody!

As a newbie who did some basic vba-programming I am wondering if it is possible to have a macro running in the background while modifying a sheet?

The idea is to use a cell content change as a trigger to modify the whole row by the said macro. I assume this must be a macro being started each time the workbook is opened (which I have already managed) and then being kept running in the background and perform at each trigger event.

If this is possible in general, I have no idea.

Thank you in advance for any help!

Hide Macro Execution
How can I make Excel to hide macro execution to accelerate my programm?

Excel Macro Execution From VB
OK, I've been up and down the forums looking for the answer to my current question here and have come up with nothing. The problem here is very simple and I think I'm fairly close....

The scenario is this...my app creates a CSV file, when finished, it loads it into excel...I have a macro .already created that does formatting for these particular files, whether they come out of my program or not. That macro is run from a user created menu that is initially created from an XLA file loaded in the XLSTART folder.

From VB, how do I do either of the following.

1) Execute that user-defined menu, in result, running that marco?

or

2) Execute that macro directly.

As far as executing it directly, I've tried the following:

Dim xlApp As Excel.Application

Set xlApp = CreateObject("Excel.Application")

xlApp.Run "C:PROGRAM FILESMICROSOFT OFFICEOFFICEXLSTARTFVMENU.XLA!fxhead.fixhead"

The macro (along with many others) is contained in this "FVMENU.XLA" file. The macro "FIXHEAD" is in a module called "FXHEAD".

Like I said, this is probably an easy one but for some reason I just can't get over this hump....if you can help me out at all, I'd really appreciate it.

Sibby

On Macro Execution VB Editor Pops Up?
This is no doubt a n00bish issue (I'm newish to VB and brand new to office scripting) but every time i execute a macro I have to insert text into an open message / create a new message depending on option selected it all works perfect except for 1 issue, the VB Scrip Editor always pops up and takes focus, and I'd prefer for it to remain hidden.

Heres 1 of the offending code items as an example:


Code:
Private Sub btnSig_Click()
'Not sure what this does, copied the ****
On Error GoTo NoEmailOpen
Dim objApp As Application
Dim myNamespace As Outlook.NameSpace
Dim objMsg As Object
Set objApp = CreateObject("Outlook.Application")
Set myNamespace = Application.GetNamespace("MAPI")
Set objItem = objApp.ActiveInspector.CurrentItem
'Get full sig info and check its there, then paste into current message
Call GetFullSig
If strFullSig = "" Then
Exit Sub
Else
objItem.Body = objItem.Body & strFullSig
End
End If
NoEmailOpen:
Select Case Err.Number
Case 91
MsgBox "Signatures can only be created when an" & _
vbCrLf & "email is already open", 16, "Error detected"
Exit Sub
Case Else
MsgBox "An unhandled error has been detected." & vbCrLf & "Please" & _
"note what was happening when it occured and email " & _
"Steven.", 16, "An unhandled error has occured"
End Select
End Sub
Cheers for any help

Update Query Execution
hai all
i have a form in which i have to update some data i writen my code like below but it is not affecting the database the same query i am runnimg in my oracle command propmt it is updating plz verify my code and give me suggestions


Code:
OpenCon
If ConMain.state = adStateOpen Then
str = "UPDATE temp2 SET dt=(SELECT edate From temp1 WHERE temp2.Cat!=temp1.ad AND ROWNUM = 1 AND temp2.bcd = temp1.scode AND temp2.bnd=temp1.srcode) WHERE temp2.dt IS NULL"
rs.Open str, ConMain, adOpenDynamic
MsgBox "The Connection is now open!"
Else
MsgBox "Sorry. The connection could not be opened."
End If

plz help its urgent
thank u in advance

Execution Of Macro When Contents Of Cell Changed?
Hi,

i have a question regarding execution of macros. Can i execute a macro only when contents of one particular cell in a worksheet are changed?

I know that i can execute macro anytime when the contents of the whole worksheet are changed but i think that in my case it would wasteful, because i need to execute a macro only when the contents of one cell are changed!

Gatis

Access2000 - Unattended Execution Of A Macro / Procedure
I'm attempting to externally run an 'unatttended' Access database update procedure without very much luck.. < huge groan >.

Environment:
   Access 2000
   User Level Security ie Username/Password - ( NO share level / database password security )
   Win2K Advanced Server with Terminal Services.

To this cause, I have tried:

1. Launching the Access executable with user and pwd parameters from Task Scheduler - Everything runs fine if the procedure is run directly out of a BAT file. However, when I run it from Task Scheduler.. Task scheduler just hangs in a running state.

2. Launching the Access database via [CreateObject] Automation - Here, regardless of what I do, I am always rewarded with an Access Logon prompt.. ( which, by the way, when I enter a valid UserId / Password always replies with a logon failed message.. < even bigger groan > ).

3. I have read and thought about Shandy's very worthy FAQ on running Access Reports unattended. Unfortunately, in Access VBA I know of no way to give the Logon Prompt focus ( without using APIs ).. so Shandy's send key solution is one of total last recourse.

Soooooooooooooooooooo.. my question is: Does anyone know of a way to run a Procedure / Macro contained within an Access database.. in an unattended ( no user intervention required / password prompt ) manner ?

Thank YOU.. < smile >

PSsssst... Yes, i do understand that if I just leave the Access database open 24/7 on a timer.. I can achieve this goal. However, this solution chews up resources and heightens the risk of DB corruption and / or enhances the chance of interoperability problems.

Oh.. and one more last thing.. HEEELLLLLLPPPPPPPPPPP!!!!... < silly smile > and a < wink >.

Query Execution And Recordset Update
Hi there fellow problem magnets
I have the following problem.
I am using vb6 and MS Access 2003.
In access i have a query "qryTask_GetByCommon" which queries a table called "tblTasks". When the query is executed it asks me for the first of 2 parameters. The first parameter is called "pItem" or LIKE [pItem] & "*" in the query criteria and the second is "pTaskID" or [pTaskID] in the criteria.
The query works fine and i can enter any letter i.e. "T" in the first parameter and the LIKE function works ok. It returns all taske beginning with "T"

BUT

when i try to populate a recordset using the results of the query i get nothing.

here is the code

i have omitted all the database guff etc.
Also text1 and text2 are parameters [pItem] and [pTaskID] respectively

below is the code behind a button on form1

Private Sub btnGetTasks()
getdata rsTasks , "qryTask_GetByCommon", text1, text2

' in here i get data from the returned recordset (but its empty)
' but running the query it returns values ???


End sub

below is the code in a module

Public Function GetData(ByRef rs As ADODB.Recordset, strQuery As String)
Dim cmd As New ADODB.Command
Dim prm As New ADODB.Parameter
If rs.State = 1 Then rs.Close
cmd.ActiveConnection = DB
cmd.CommandText = strQuery
cmd.CommandType = adCmdStoredProc

Set prm = cmd.CreateParameter("pItem", adVariant, adParamInput)
prm = text1
cmd.Parameters.Append prm

Set prm = cmd.CreateParameter("pTaskID", adInteger, adParamInput)
prm = text2
cmd.Parameters.Append prm

Set rs = cmd.Execute
End Function


and clues

Thanx in advance

grommit

Stop Macro?
Help me.
I made a macro that makes a set of tasks but not like stopping the execution when the user presses the key esc. As I capture with VB for applications a pulsation of keyboard and stop the execution of the macro.


PD: Alguien habla español

Mima

 

About Stop A Running Macro
how to stop a running macro when pressing a key on keyboard !
like if a macro is running ( doing a loop) , how can i stop it when i press a key "esc" ?

bcuz that's a loop , how can i stop it without effecting other macro (API)

is that possible to achieve that ?

Stop TextBox Update
I have heard there is a way to stop a text box from updating, in order to speed up code for instance if you concatenate the textbox.text in a loop. Could anyone tell me how? I dont think theres an update property or anything...

Macro Does NOT STOP.. Is BLIND To ESC Or CTRL + BREAK!!!!
My program is totally blind to ESC or CTRL+BREAK, despite adding error handling code. Can anybody identify from the below program summary what may be to blame! Thanks for the help..you guys on this board kick ass!!!

Sub ABC ()

Browseforfolder ' Call browse folder function (Thanks Guys!!)
.
.
Application.EnableCancelKey = xlErrorHandler
On Error GoTo ErrHandler
.
.
For x = 1 to N

ActiveWorkbook.FollowHyperlink.......
Sendkeys .... ' to submit some data, print result in pdf, then save to folder
.
.
Next x


ErrHandler:

If Err = 18 Then
lContinue = MsgBox( _
"Do you want to Continue (YES)?" & vbCrLf & _
"Do you want to QUIT? [Click NO]", _
Buttons:=vbYesNo)
If lContinue = vbYes Then
Resume
Else
Application.EnableCancelKey = xlInterrupt
MsgBox ("Program ended")
Exit Sub
End If
End If

Application.EnableCancelKey = xlInterrupt

End Sub

Why Does My Datagrid Update Automatically And How Do I Stop It?
Why does my datagrid update automatically and how do I stop it?

It's driving me crazy. I want to update my datagrid on the click of the update button. But the stupid thing updates and commits everything I do as soon as I do it. How do I prevent this?

How Do I Stop The Print Macro Definition Dialog From Opening
Hi There,

I've got a simple autoexec macro that has three steps (using MS Access 97):

Opens a reports
prints out the report
Quits MS Access

However when it is run a dialog box pops up: "Print Macro Definition" with three check box options.

I do not want this to pop up. How do I turn it off?????

Regards, Troys.



Edited by - troys on 3/9/2004 7:39:00 PM

Stop Full-Screen Web Browser.
I've been fooling around with the MS Internet Controls, mostly the web-browser. I noticed that if you goto a site that causes the browser to go full-screen it will resize itself and cover almost everything in your form. Is there a way to stop this from happening?

Stop Form From Dragging Off-Screen
I've searched this quite a bit and keep coming up with the same results... all of which don't really solve the problem...

I have a form that I want users to drag, however, I do not want the form to cross the edges of the screen. That is, I do not want any part of the form to disappear outside the screen. The only code I've found close to this is one to snap the form to the edge of the screen (while still allowing it to be pushed outside the screen).

I've tried using the mouse position API for the form, but it doesn't capture the X and Y coordinates for when you're over the form's border. I understand this to only see the INSIDE of the form, and not the form's border included.

Thanks in advance!

Stop Repainting Of Screen Temporarily
I am creating a program in which I have to move images around the screen to test for a condition, then move the images back to where they were to start with (its a chess program...have to see if player is in check before allowing the move).

Is there any way I can turn off the redrawing of the screen/form/images while the pieces are moving and then turn it on again when they're done? Thanks for your help!

Excel 200, Stop Links Message &amp; Update.
I have a spreadsheet with links to an external source. Is it possible to not display the Update Links message on Opening and to Not update the links.

I have seen code to turn off the Update links message but this then automatically updates the links which is no good.

The spreadsheet is being sent to people who won't have access to the base information, so will delete all data if user presses wrong button etc.

Don't think this is possible but any help given is much appreciated.

Regards.

rob.

Stop Minimize From Full Screen From Closing
I play Final Fantasy XI and when you go into the game it is full screen like most games. Thing is when I try to tab out of the game it says something about full screen lost an the game closes.

I would like to figure out how to go about stopping the game from closing. I have seen a few third party applications out there that can do this but I am not really a fan of third party applications unless they are my own.

Does anyone have any idea what I would have to do to stop it from closing when I do this?

Detect And Stop Mouse Click Anywhere On Screen?
I'm currently using this code to detect a mouse click any where on screen and retrieve the pixel color underneath:

Code:
Dim tPOS As POINTAPI
Dim sTmp As String
Dim lColor As Long
Dim lDC As Long
lDC = GetWindowDC(0)
Call GetCursorPos(tPOS)
lColor = GetPixel(lDC, tPOS.X, tPOS.Y)
' sTmp = Right$("000000" & Hex(lColor), 6)
inputtext.Text = lColor
tester = GetAsyncKeyState(vbKeyEscape)
If tester And &H8000 Then
Timer1.Interval = 0
Timer1.Enabled = False
Beep
End If



My question is: how can I also stop the mouse click from executing?

I have a 'color picker' program so the user can select any color on-screen, but when they click to select the pixel, the click changes Focus, or selects what's underneath, etc.

I want the pixel color, but not the mouse click....

Update Styles With Macro
We are altering the format of our firm's documents. I need to create a script that runs over the document, updating it to the new style. The new style is basically changing the font to Times New Roman, and changing to sentence case.

I am having trouble updating those styles (I am using Word2002, and styles SUCK in this version). I can easily get the standard font itself to change, but not the numbering style.

I have to use options because the style level differs from a standard document to a deed or agreement (i.e heading 1 is bold, caps in an agreement, but just number 1 in normal document).

I am loathe to copy the script in here as it is a long one, so will edit the repetitive information out. Is there a cleaner way of just "updating style" to template?. I put two coding below, one is my first attempt, and my second.

Also, does anyone know of a realllllllly good advanced word forum? My main gripe with word2002 is how it thinks toooo much for itself. I want to stop it automatically adding styles with every different format, and only list my standard ones.. try as i might and deselect everything, it won't!! (see my code at end of each script below to try and get it to stop!)


Code:
Private Sub CommandButton1_Click() 'ok button
Dim iType As Integer


'get value from option buttons to use in subsequent case statements
If Me.OptionButton1 Then iType = 1
If Me.OptionButton2 Then iType = 2


'close user form
Me.hide
Unload Form2003


Select Case iType
Case 1 'Deed/Agreement

With ActiveDocument.Styles("Normal").Font
.Name = "Times New Roman"
End With
With ActiveDocument.Styles("Heading 1,1.").Font
.Name = "Times New Roman"
.Size = 14
.AllCaps = False
End With
ActiveDocument.Styles("Heading 1,1.").NoSpaceBetweenParagraphsOfSameStyle _
= False
With ListGalleries(wdOutlineNumberGallery).ListTemplates(4).ListLevels(1)
With .Font
.Name = "Times New Roman"
End With
.LinkedStyle = "Heading 1"
End With
With ListGalleries(wdOutlineNumberGallery).ListTemplates(4).ListLevels(2)
With .Font
.Name = "Times New Roman"
End With
.LinkedStyle = "Heading 2"
End With
'etc etc
ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
ListGalleries(wdOutlineNumberGallery).ListTemplates(4), ListLevelNumber:= _
1
With ActiveDocument.Styles("Heading 1,1.").Font
.Name = "Times New Roman"
.Size = "14"
End With
With ActiveDocument.Styles("Heading 1")
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "Body Text Indent"
End With
With ActiveDocument.Styles("Sched/Annex").Font
.Name = "Times New Roman"
.AllCaps = False
End With
' and so on and so on

'hide all but current heading styles

With ActiveDocument
.UpdateStylesOnOpen = False
End With
ActiveDocument.FormattingShowFont = False
ActiveDocument.FormattingShowClear = False
ActiveDocument.FormattingShowParagraph = False
ActiveDocument.FormattingShowNumbering = False


Case 2 'Plain/Letter

With ActiveDocument.Styles("Normal").Font
.Name = "Times New Roman"
End With
With ListGalleries(wdOutlineNumberGallery).ListTemplates(5).ListLevels(1)
With .Font
.Size = 14
.Name = "Times New Roman"
End With
.LinkedStyle = "Heading 1"
End With
With ListGalleries(wdOutlineNumberGallery).ListTemplates(4).ListLevels(2)
With .Font
.Name = "Times New Roman"
End With
.LinkedStyle = "Heading 2"
End With
With ListGalleries(wdOutlineNumberGallery).ListTemplates(4).ListLevels(3)
With .Font
.Name = "Times New Roman"
End With
.LinkedStyle = "Heading 3"
End With
'etc etc
With ActiveDocument.Styles("Heading 3,(a)").Font
.Name = "Times New Roman"
End With
With ActiveDocument.Styles("Heading 3")
.AutomaticallyUpdate = False
.BaseStyle = "Normal"
.NextParagraphStyle = "Body Text Indent (a)"
End With
'etc etc
ActiveDocument.FormattingShowFont = False
ActiveDocument.FormattingShowClear = False
ActiveDocument.FormattingShowParagraph = False
ActiveDocument.FormattingShowNumbering = False
End Select

MsgBox "Conversion to Format 2003 is complete. Please save and check your document.", vbExclamation + vbOKOnly

Exit Sub
End Sub
Private Sub CommandButton2_Click() 'cancel button
Unload Form2003
End Sub

this was my other attempt, it would change the font, but not the styles, so adding a new paragraph, it would resort to old style

Code:
Sub Main()
' RLH 29/1/03 Macro created to convert existing documents to new
' Format2003 style. Copies styles from attached template down to
' document and applies them. Forces some styles to certain cases.
'
Dim Template
Dim ActiveDoc
Dim Style

On Error Resume Next

If ActiveDocument.AttachedTemplate = "Agreement.dot" Then
GoTo Update
ElseIf ActiveDocument.AttachedTemplate = "Deed.dot" Then
GoTo Update
ElseIf ActiveDocument.AttachedTemplate = "Normal.dot" Then
GoTo Update
ElseIf ActiveDocument.AttachedTemplate = "Format2000.dot" Then
GoTo Update
Else
Selection.WholeStory
Selection.Font.Name = "Times New Roman"
Selection.HomeKey Unit:=wdStory
End
End If

Update:
If ActiveDocument.AttachedTemplate = "Normal.dot" Then
ActiveDocument.AttachedTemplate = "C:Program FilesMicrosoft OfficeTemplatesformat2000.dot"
End If

Template = ActiveDocument.AttachedTemplate.Path & "" & ActiveDocument.AttachedTemplate
ActiveDoc = ActiveDocument.Path & Application.PathSeparator & ActiveDocument.Name

ActiveDocument.UpdateStyles

Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With


Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Doc Title")
Selection.Find.Execute
If Selection.Find.found = True Then
Do
Selection.Range.Case = wdLowerCase
Selection.Range.Case = wdTitleWord
Selection.Find.Execute
Loop Until Selection.Find.found = False
End If

'etc etc

Selection.HomeKey Unit:=wdStory

With ActiveDocument
.UpdateStylesOnOpen = False
End With

End Sub

How To Update Data In SQL Using Macro
Hi all...


I would like to ask how to update data using macro

Example:

A B C
aaa bbb
111 222

I have 2 column(displayed by using select statement from Macro) using code:

sql = " select * from coltable"
rs.Open sql, con, adOpenKeyset

Column A & B are displayed, and it still have another column C that doesnt have any value in it(blank).

I want to entry the data in column C and automatically updating it in SQL Server 2000


How to achieve this

Any advice? thx

Update 95 Macro To Excel 97
Hello,

I have a program which still works when I run it on excel
95.
I now have to run it on excel 97, but I am getting a
variety of errors. I have been told by someone that the program is not
getting the data it requires from an access database
titled hyb.mdb.
I think the code shown below may need altering, but I know
nothing about programming.
Can anyone help please ?

Kind regards,
Laila.

Sub Capture(tabname, campo, destran)
Static chan As Integer
'
If CStr(SQLGetSchema(chan, 7)) = CStr(CVErr(2015)) Then
dataname = "Hyb.mdb"
chan = CInt(SQLOpen("DSN=" & dataname))
End If
'
questr = "SELECT DISTINCTROW " & tabname & ".F" &
campo & " FROM " _
& tabname & ";"
SQLExecQuery chan, questr
Set output = Range(destran)

Range(destran) = SQLRetrieve(chan, output, , , True)

End Sub

Sub CaptureCell(tabname, campo, DesWkBook, DesWSheet,
DesRow, DesCol)
Static chan As Integer
'
If CStr(SQLGetSchema(chan, 7)) = CStr(CVErr(2015)) Then
dataname = "Hyb.mdb"
chan = CInt(SQLOpen("DSN=" & dataname))
End If
'
questr = "SELECT DISTINCTROW " & tabname & ".F" &
campo & " FROM " _
& tabname & ";"
SQLExecQuery chan, questr
Set output = Workbooks(DesWkBook).Worksheets
(DesWSheet).Cells(DesRow, DesCol)

Workbooks(DesWkBook).Worksheets(DesWSheet).Cells
(DesRow, DesCol) = SQLRetrieve(chan, output, , , True)

End Sub

.

How To Use VBA To Automatically Update Macro In Another Workbook
Hi,
I am currently writing some VBA script for excel, due to time constraint, I have to release the early version of utility to the users, all together there are more than 6 copies of them distributed out.

Question,
1) For every change of new revision, I have to copy the latest macro to the users workbook manually, it is not a present experience of manual updating. Is there a way to automatically delete the old macro module then add the latest module onto the workbook without overwriting the data on the workbook.

I have tried using the macro recorder to extra the code out..but no code is generated.


2) How to enforce user select macro running option while excel startup. If user do not select macro running, is there a way to detect it.


thanks alot
regards
kaileong

Update Field Using Word Macro
Hello,

I add a field "page number" in word document using word macro
But I can't get correct number. After I use select all and press F9, I will get field update and get right answer. But I can do it in word macro. Does anyone know why does this happen?

Thanks,
vicky

Screen Update??
hello

is there any way I can make my prgram quit "flashing" while executing??
its a long code and it flashes way to much!
I think its a screen update command but im not sure, does anyone know what the code is???

thanks in advance!

VB6: Is Is Possible To Write A Program That Will Update An Excel Macro?
Using VB6 I want to update an excel spreadsheet. This is an easy task, however the spreadsheet I am updating contains a dropdown box right on the sheet. I want to write a program that will allow me to access the spreadsheets macro module and insert lines of code. Is this possible?

Screen Update Issue.
Hi I have an excel vba program which generates a sheet using an existing sheet under certain criteria.

My problem is not such a big deal to me but it will be to my boss, so I would appreciate some feedback.

When my form is loaded and I drag it somewhere else on screen an imprint of it is left behind.

On startup of my form I load a 2mb file which will increase in size as time goes on, I believe that this may be the cause of the issue because the filesize is so big, although I may be wrong.

Anyway is there anything i can do to stop this. I have attached an image to try and show you what I mean.

Thanks

Excel Screen Update......
Does anyone know how to turn the screen update off in excel

I thought it was...
Dim O as object
Set O = CreateObject("excel.application")
O.screenupdate = false

Nope....Doesn't work

Screen Update Events?
I am working on a screen capture program to capture video. I have
found that occasionally it would be better instead of capturing video
at X many frames per second to only record the frames that change to
make a smooth video. Certain streaming videos, video conferencing
software and webcams will send a lot of frames in a burst and then no
frames for a while. What type of event can I trap to determine if
something has changed in a region on the screen to see if the program
should capture or not? Any ideas appreciated!

Barb

Macro To Import An Adobe Screen Shot
Does anyone have any ideas on how to create a macro that will import an Object into an Access Database table? When a user clicks a button the dialog button will open with the option to insert an object. The current manual method is to right click on an OLE Object defined cell, click the Insert Object option,select one of the two radio buttons r Create New, or Create from File,choose Object Type, click OK then browse folders for Object. With a macro button to facilitate the start of this activity, a user would have a simpler time populating a database table requiring OLE embedded objects. The user would click the macro button, Insert Picture the dialog boxes with instructions to accompany this activity would begin, as if the user had right clicked on an OLE defined cell.

Macro To Update Excel File (simple But For One Big Problem)
Dear All,

I have a problem with the automatic updating of a file - the updating process is roughly as follows:

There are 4 separate rows in Excel, that need updating
The problem is the macro does not consider that i want to keep the information updated from the past (the formulas are only dragged down from the first cell to the one below) - I need Excel to understand that I actually want to keep the updated information and to copy the cells down further

I think the problem is that Excel works using cell references. So when I use VBA to copy cell A13 to A14 it always does this when run. But I want to next time copy cell A14 to A15 and then next time from cell A15 to A16 and so on...In the file I am creating this also means inserting some cells - but the main problem I have is getting Excel to understand that I want this file to update, but not to continuously overwrite past information saved.


Look forward to a reply,

internationally

VB 6.0 - Display Hourglass During Execution And Revert To Default After Execution
Hello gentlemen,
could some someone show me an effective way for my mouse to display the hourglass during execution of my module and revert to Normal after execution?

This is my module:

Code:
Private Sub cmdGo_Click()

Screen.MousePointer = vbHourglass

If Me.Text1 = "NYCTA" Or Me.Text1 = "nycta" Then
Me.Text2.SetFocus
Else
MsgBox ("Please enter a correct userid and try again"), vbCritical, "Utility Sign-on"
Me.Text1 = ""
Me.Text1.SetFocus
Screen.MousePointer = vbDefault
Exit Sub
End If

If Me.Text2 = "NYCTA" Or Me.Text2 = "nycta" Then
Me.Frame3.Visible = False
Me.Command1.Visible = True
Me.Command2.Visible = True
Me.Command3.Visible = True
Me.Command4.Visible = True
Me.Command5.Visible = True
Me.Command6.Visible = True
Me.Command9.Visible = True
Me.Command10.Visible = True
Me.Command11.Visible = True
Me.Command1.SetFocus
Else
MsgBox ("Please enter a correct password and try again"), vbCritical, "Utility Sign-on"
Me.Text2 = ""
Me.Text2.SetFocus
Screen.MousePointer = vbDefault
Exit Sub
End If
End Sub


Thanks a mil.
GiftX.

Has Listview Got A Update.screen = False ?
I've a listview box on my form with loads of data in, is there a way it can be stopped from displaying new info untill the procedure is completed?

Screen Refuses To Update Properly
i have the following module:

Code:
Public Sub DrawScreen()
Dim str As String
Dim curHour As Integer
Dim curMin As String
Dim stat As String
stat = "AM"
imgBuffer.Cls

'START TIME!!!
imgBuffer.CurrentY = 0
curHour = Hour(Time)
curMin = Minute(Time)

If curHour > 12 Then curHour = curHour - 12
If curMin < 10 Then curMin = "0" & curMin
If Hour(Time) > 12 Then stat = "PM"
str = curHour & ":" & curMin & " " & stat

imgBuffer.CurrentX = (imgBuffer.Width - imgBuffer.TextWidth(str)) / 2
imgBuffer.Print str

'END TIME!!!

imgBuffer.Line (2, imgBuffer.TextHeight(str))-(imgBuffer.Width - 2, imgBuffer.TextHeight(str)), RGB(30, 30, 30)


'BEGIN PLAYSCREEN
If bOnPlay = True Then

End If
'END PLAYSCREEN


'BEGIN MENU
If bOnPlay = False Then

End If
'END MENU


BitBlt imgScreen.hDC, 0, 0, imgScreen.Width, imgScreen.Height, imgBuffer.hDC, 0, 0, vbSrcCopy

End Sub
i have a timer set up to call this function every second. for some reason, it isnt actually calling it. i dont understand what is wrong with it. it just doesnt update the screen. whenever i call it from another sub, it works fine though. if you need to see more code to figure it out, lemme know. but i think ive just dont something stupid in here somewhere. or is there something about a timer i need to know? thanks

daniel

Basic VB Macro Loop For Pasting Screen Shots
I am very new to VB and know a little bit about macros.
I want to automate the pasting of screen shots from a program to MS power point and then create a new slide. To which the paste function happens again.
I have copied the original recorded macro, how do I create a loop of this for say 25 steps (can this number be made a variable).

Sub Macro2()
'
' Macro recorded 1/11/2005 by me
'

ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=4, Layout:=ppLayoutBlank).SlideIndex
ActiveWindow.View.Paste
End Sub

Cheers

Indefinitely Saving Variables (from Execution To Execution)
I would like to know the best way to save a variable from execution to execution. So to say if the user sets this variable to 2000 then a week later the program is run again, this variable is called from a file it was saved in.

I'm thinking this is done by writing a common dll file but what's the best way to do this (read and write say 6 variables to and from a file??)

Excel Macro --&gt; Link *.foo File To Cell And Update *.foo Date Time
Hey All

Could someone show me a quick way to program two macros. These will be used in Excel to help me automate many of our tasks.
The first one would simply open up an "explorer" window and show only *.foo files. The directory should always point to the same directory everytime it's called. In other words, when I first run the macro I point it to W:, and every subsequent time after that it points to W:. Secondly all I want from the file is the Name and Location. I don't want to open the file. Basically a hyperlink to the file, that when depressed would be opened by the default extension. (i.e. .txt -&gt; notepad)
The second Macro would get the Name and Location from the above macro and return the Creation Date and Time. And place that in the cell.

Again thanks so much.



------------------
Steven M. Klass
Physical Design Engineer

Andigilog Inc.
7404 W. Detroit Street, Suite 100
Chandler, AZ 85226
Ph: 602-940-6200 ext. 18
Fax: 602-940-4255

sklass@andigilog.com
http://www.andigilog.com/

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