I get vba error 462 the remote server machine does not exist or is unavailable
Hello Fellows
I get the above error when i run the code bellow , but when i re-run it after the error occur, the code seems to Work fine. For sure im missing something in it. Can you point me the right way to do this?
Thanks in advanced.
First sub:
Private Sub Command54_Click()Forms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Verb = acOLEVerbOpenForms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Verb = acOLEVerbOpenSet GeraKit0 = Forms!frmFScomposicao!subfrmKitCenas!FSKitCenasOLE.RangeWith GeraKit0.SelectGeraKit0.WholeStoryGeraKit0.DeleteEnd WithDim FirstTime As IntegerFirstTime = 1Me.FirstTimeBox = FirstTimeForms!frmFScomposicao!PRODUCAO.SetFocusDoCmd.RunCommand acCmdRecordsGoToFirstFor f = 1 To Forms!frmFScomposicao!PRODUCAO![Tiroliro]Me.FirstTimeBox = FirstTimeCall CompilarKitDiaGravacaoForms!frmFScomposicao!PRODUCAO.SetFocusFirstTime = FirstTime + 1DoCmd.RunCommand acCmdRecordsGoToNextNext fDoCmd.RunCommand acCmdRecordsGoToFirstEnd Sub
It seems that you are somehow working with a Word document (as indicated by some of the code, such as inserting a continuous section break), but I don't see code to either create a Word doc or set a reference to an existing doc. What exactly is the code doing (in words)?
Armando Vilela Baiões
ASKER
Hello.
I have a main form with two sub forms one of the sub forms contains a list of several OLE selected word documents, in which I loop, passing all these documents to another sub form, which also contains an OLE Field, which will gather these Documents, in one.
Armando Vilela Baiões
ASKER
It may be something to do with one of the subforms, only when I make the selection of new documents the error occurs the first time I try the code, then if I try again, the code works.
I quit (for today), maybe i need some rest... If anyone have any ideia, please post!
Armando Vilela Baiões
ASKER
I made some changes to the code, but im still getting the same error, but on a diferent line (underscored).
Heres the code so far:
Public Sub CompilarKitDiaGravacao()Dim CenasParaRecolha As ObjectDim DocumentoDestino As Object Set CenasParaRecolha = Forms!frmFScomposicao!PRODUCAO![Prod_Cena_Guiao].Object.Application.WordBasic Forms!frmFScomposicao!PRODUCAO![Prod_Cena_Guiao].Action = acOLEActivate With CenasParaRecolha Selection.WholeStory Selection.Copy End WithIf Forms!frmFScomposicao.FirstTimeBox = 1 Then Forms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Action = acOLEPaste Set DocumentoDestino = Forms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Object.Application.WordBasic Forms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Action = acOLEActivate With DocumentoDestino Selection.WholeStory Selection.Delete Selection.EndKey wdStory Selection.InsertBreak Type:=wdSectionBreakContinuous Selection.PasteAndFormat wdPasteDefault End With Forms!frmFScomposicao!FirstTimeBox = Forms!frmFScomposicao!FirstTimeBox + 1Else Set DocumentoDestino = Forms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Object.Application.WordBasic Forms!frmFScomposicao!subfrmKitCenas![FSKitCenasOLE].Action = acOLEActivate With DocumentoDestino Selection.EndKey wdStory Selection.InsertBreak 'Type:=wdSectionBreakContinuous Selection.PasteAndFormat wdPasteDefault End WithEnd IfSet CenasParaRecolha = NothingSet DocumentoDestino = NothingEnd Sub