sempre que executo minha macro de copiar e colar, a celula que eu dei de referencia para copia continua marcada, tem algum codigo para desfazer essa marcação?
segue minha macro.
REM ***** BASIC *****
Option VBASupport 1
Global document As Object
Global dispatcher As Object
Sub Abre
Call DocDisp 'Uso Geral
Call IrPara "Maio2020.O2"
Call Copiar
Call IrPara "Maio2020.G1" rem Primeira celula da coluna de Status
Call PrimeiraVazia
Call Colar
Call IrPara "Maio2020.J3"
Call Copiadata
Call IrPara "Maio2020.H1"
Call PrimeiraVaziaD
Call Coladata
Call Linha
end Sub
' Call é usado para chamar outra Macro.
Sub DocDisp
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
end Sub
'=========================================================================
sub IrPara (xlocal as string)
'xlocal = "Maio2020.O2"
'exemplo uso: IrPara "Planilha.A1" ou "Planila1.A1:B3" ou "NomeArea"
'=========================================================================
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = xlocal
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
end sub
'=========================================================================
sub Copiar
'=========================================================================
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
end sub
'=========================================================================
sub PrimeiraVazia
'=========================================================================
dispatcher.executeDispatch(document, ".uno:GoDownToEndOfData", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, Array())
end sub
'=========================================================================
sub Colar
'=========================================================================
dim args2(5) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Flags"
args2(0).Value = "SVD"
args2(1).Name = "FormulaCommand"
args2(1).Value = 0
args2(2).Name = "SkipEmptyCells"
args2(2).Value = false
args2(3).Name = "Transpose"
args2(3).Value = false
args2(4).Name = "AsLink"
args2(4).Value = false
args2(5).Name = "MoveMode"
args2(5).Value = 4
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args2())
end sub
rem encerra primeira parte======================
sub Copiadata
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
end sub
sub PrimeiraVaziaD
'=========================================================================
dispatcher.executeDispatch(document, ".uno:GoDownToEndOfData", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, Array())
end sub
sub Coladata
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(5) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Flags"
args1(0).Value = "SVD"
args1(1).Name = "FormulaCommand"
args1(1).Value = 0
args1(2).Name = "SkipEmptyCells"
args1(2).Value = false
args1(3).Name = "Transpose"
args1(3).Value = false
args1(4).Name = "AsLink"
args1(4).Value = false
args1(5).Name = "MoveMode"
args1(5).Value = 4
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args1())
dispatcher.executeDispatch(document, ".uno:SetInputMode", "", 0, Array())
dispatcher.executeDispatch(document, ".uno:Cancel", "", 0, Array())
end sub