ImagePro>Re: Disappearing mouse


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ImagePro>Re: Disappearing mouse



> -----Original Message-----
> From: Image-Pro Plus Users Email List
> [mailto:imagepro-users@lists.mediacy.com]On Behalf Of Tarachandani, Anil
> Sent: Friday, December 14, 2001 3:56 PM
> To: Image-Pro Plus Users Email List
> Subject: ImagePro>Disappearing mouse
>
>
> Hello:
>
> I am using ImagePro 4.5.0.22 with Windows NT and analyzing
> images. I export
> data using OLE to Excel using a very similar macro to the demo-macro from
> Kevin Ryan published in this newsgroup,16 May, 2001.
>
>
> However, there are two issues which are irritating.
>
> 1. My macro typically processes a directory and after it is done it stops.
> If I close Excel immediately after that - Excel crashes. But if I hit the
> "stop" button on the macro and then close Excel then all is well.
> Is there a
> command to make the macro "stop" so I dont have to manually "stop" after
> each run?

There is an issue with who is holding which copy of Excel - I suggest that
after you have done something with Excel that you immediately set the Excel
object to "Nothing", as in:

	exlObj = Nothing

This will delete the IPP macro COM pointer to the Excel instance, and allow
you to exit Excel normally. What I have been doing to avoid this problem is
to wrap my calls to Excel in calls to get a pointer and to set that pointer
to Nothing, so that none of my macros ever exits without clearing the Excel
object. This seems to resolve the problem.

Otherwise you have deleted the running Excel without closing out all COM
pointers to it, and the next call to Excel is a problem.

The following is the subroutine I currently use to get a pointer to Excel:

Function Get_Excel(exl As Object) As Integer
	Dim i%

	' GetObject fails if Excel isn't running,
	' hence the On Error statement.
	On Error GoTo  run_excel

	Set exl = GetObject(,"Excel.Application")
	GoTo excel_running

run_excel:
	' Start Excel via CreateObject. If this
	' fails, we exit the macro.
	On Error GoTo error_excel

	Set exl = CreateObject("Excel.Application")

excel_running:
	On Error GoTo error_excel_running

	' Show Excel (don't run in background)
	exl.Visible = True
	Get_Excel = 0		' return success
	Exit Function

	' Error handling
error_excel:
	Debug.Print "Can't find Excel"
	Get_Excel = -1		' return failure
	Exit Function
error_excel_running:
	Debug.Print "Error showing Excel"
	Get_Excel = -2		' return failure in show
End Function


> 2. After the macro has been used to process files (~2000-3000
> files) or half
> a day worth of processing, the mouse cursor dissappears. The computer has
> NOT crashed. If I move the mouse (which I cannot see on the screen) I can
> find menu items and click them. I can select items using the
> keyboard but it
> requires a restart to see the mouse again. This happens at random
> intervals
> after ImagePro has been used to process data but usually happens after
> processing more than ~2000 files. (Task-manager does not show anything
> unusual - no process running after the macro is done and no
> excessive use of
> memory).

Try the above technique first, and see if you still see the problem. In the
meantime I'll forward that on to Tech Support for testing here, but it may
be difficult to replicate.

-- Kevin Ryan
kevin@mediacy.com


***********************************************************
Need an Image-Pro macro or driver? Find it at http://www.Solutions-Zone.com
Got an Image-Pro macro or driver? Add it to http://www.Solutions-Zone.com
***********************************************************

This message is sent to you because you are subscribed to <imagepro-users@lists.mediacy.com>.
To unsubscribe, email to: <imagepro-users-off@lists.mediacy.com>
To switch to the DIGEST mode, email to <imagepro-users-digest@lists.mediacy.com>
To switch to the INDEX mode, email to <imagepro-users-index@lists.mediacy.com>
Send administrative queries to  <imagepro-users-request@lists.mediacy.com>
To subscribe or unsubscribe visit http://www.solutions-zone.com/ipednld/subscriber.asp



Search this Archive