Andrew Jensen wrote:


That looks like a bug in OO.o 1.0.x where macros called from the
commandline when starting the office where invoked twice. Should be
fixed somewhere in the step to 1.1, but using a global boolean outside
any sub did fix it for me.

global hasrun as boolean

sub importCSVfromCommandline(file as string)
	dim typ as string
	typ = left(FileNameoutofPath(file),2)
	msgbox file + " : " + typ
	importCSV(file, typ)
end sub

sub importCSV(file as string, typ as string)
	if hasrun = FALSE then
		hasrun =TRUE
	else
		exit sub
	end if
	...

This way it *did* work.

  
I will give this a try and let you know..

Well, that was a fast fix. You said the "global boolean" and I simply changed my variable from a boolean to an integer

global isInOnOpenAgain as integer
sub onOpenDocument
..........
if  isInOnOpenAgain > 0 then
  ............
  isInOnOpenAgain = 0
else
  isInOnOpenAgain = 1
endif

Works without a  problem now, and leaving the test in this order offers a rather kludgy, almost, fix to the drag and drop of forms issue. Doing that does call this just once, which leaves the variable set to 1, but then the next Base file to open only hits it twice but only enters the work function once...and sets it back to 1 again on the second call. For now I can live with this as a known bug in my library till I can learn enough about the API to try and determine when I am being called from the drag and drop mechanisim.

So the last setp is to change the Frame that is about to be displayed, with the Base document in it, to hidden.

Thanks

Andrew 'Drew' Jensen


Reply via email to