Ir para conteúdo
Fórum Script Brasil
  • 0

2010 para 2003


POLIVEIRA

Pergunta

Amigos,

Preciso muito de ajuda.

estou com o programinha pronto, porem conclui a realizacao dele no excel 2010 e agora quando tento abrir no 2003 ele da um erro chamado "57121" não localiza a biblioteca...alguma coisa assim...

Ele aponta pra cá --> doc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

(((((('Dimencionar Margens da pagina

doc.PageSetup.TopMargin = Application.CentimetersToPoints(2.5)

doc.PageSetup.BottomMargin = Application.CentimetersToPoints(2.5)

doc.PageSetup.LeftMargin = Application.CentimetersToPoints(3)

doc.PageSetup.RightMargin = Application.CentimetersToPoints(3)

doc.PageSetup.HeaderDistance = Application.CentimetersToPoints(1.25)

doc.PageSetup.FooterDistance = Application.CentimetersToPoints(1.25)

'Abre Cabeçalho

doc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader )))))

E eu preciso roda-lo em uma operacao com mais de 100 pessoas que utilizao o office 2003, portanto peço encarecidamente a ajuda de voces o mais breve possivel...

A outra questão é, será que aqui no forum tem alguém de Niteroi RJ, que queria ajudar o amigo! =)

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Desculpem a insistencia, porem estou fazendo e os erros vao aparecendo.

agora quando vou gerar um documento apartir da macro ele esta dando o seguinte erro "Erro em tempo de execução: 4120 - Parametro incorreto"

Codigo:

'Abre Cabeçalho

doc.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

'Alinha logo ao centro

doc.ActiveWindow.ActivePane.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

'Formata Fonte

doc.ActiveWindow.ActivePane.Selection.Font.Size = 10

doc.ActiveWindow.ActivePane.Selection.Font.Bold = wdToggle

doc.ActiveWindow.ActivePane.Selection.Font.Italic = wdToggle

doc.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

doc.ActiveWindow.View.DisplayPageBoundaries = False

'Insere texto 1º paragrafo

doc.ActiveWindow.Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify

prg.Range.Text = stPrg1

doc.ActiveWindow.Selection.MoveDown Unit:=wdScreen <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< provavelmente deve vir o proximo também

doc.ActiveWindow.Selection.EndKey Unit:=wdLine

Set rng = prg.Range

With rng.Font

.Bold = False

.Name = "Arial"

.Size = 12

.Color = wdColorAutomatic 'TESTE DE TROCA DE COR .Color = wdColorDarkTeal

End With

If frmDadosFormulario.optCFolha.Value = True Then

intLimite = 325 ' intLimite = 325

Else

intLimite = 118 'intLimite = 118

End If

For intLin = 9 To intLimite

stPrg1 = wsSuporte.Range("A" & intLin).Text ' -----> "G"

If stPrg1 = "Em Branco" Then

doc.ActiveWindow.Selection.TypeParagraph

Else

If intLin > 9 Then

doc.ActiveWindow.Selection.TypeParagraph

doc.ActiveWindow.Selection.Range.Text = stPrg1

doc.ActiveWindow.Selection.MoveDown Unit:=wdScreen

doc.ActiveWindow.Selection.EndKey Unit:=wdLine

End If

End If

Next

Call DestaqueEmNegrito

Set ObjNetwork = CreateObject("WScript.Network")

GetUserN = ObjNetwork.UserName

UsuarioRede = GetUserN

Dim stNomeArq As String

Dim Resposta As Integer

Resposta = MsgBox("Verique o conteudo da carta, se estiver de acordo clique em Sim", vbExclamation + vbYesNo, "ATENÇÃO!")

If Resposta <> 6 Then

MsgBox "O documento não será salvo, você poderá reeditar no auto carta ou no próprio documento", vbInformation, "Atenção!"

Exit Sub

Else

stNomeArq = InputBox("O documento será salvo em sua área de trabalho, Insira o nome do documento!")

''Salvar Como':

doc.SaveAs Filename:="C:\Documents and Settings\" & UsuarioRede & "\Desktop\" & stNomeArq & ".doc", FileFormat:=wdFormatXMLDocument

'FileFormat:=wdFormatXMLDocument significa que o arquivo será salvo com a

'extensão .doc, ou seja, Documento do Word 2003.

'Agora, deseja-se sair da Aplicação. Observe que o método é executado

'no nível da Aplicação, finalizando a Aplicação e todos os objetos

'criados por ela:

appWord.Quit

End If

'Apenas para limpar memória

Set appWord = Nothing

Set doc = Nothing

Set prg = Nothing

Set ObjNetwork = Nothing

End Sub

Sub JustEmptyClipboard()

OpenClipboard (0)

EmptyClipboard

CloseClipboard

End Sub

Sub LimparCarta()

Worksheets("SUPORTE").Range("C14:C42").ClearContents

Worksheets("SUPORTE").Range("C49:C58").ClearContents

Worksheets("SUPORTE").Range("C61:C67").ClearContents

Worksheets("SUPORTE").Range("C70:C76").ClearContents

Worksheets("SUPORTE").Range("C79:C82").ClearContents

Worksheets("SUPORTE").Range("C85:C109").ClearContents

Worksheets("SUPORTE").Range("C112:C121").ClearContents

Worksheets("SUPORTE").Range("C124:C129").ClearContents

Worksheets("SUPORTE").Range("C132:C148").ClearContents

Worksheets("SUPORTE").Range("C151:C162").ClearContents

Worksheets("SUPORTE").Range("C171:C184").ClearContents

Worksheets("SUPORTE").Range("C187:C198").ClearContents

Worksheets("SUPORTE").Range("C201:C212").ClearContents

Worksheets("SUPORTE").Range("C215:C219").ClearContents

Worksheets("SUPORTE").Range("C222:C231").ClearContents

Worksheets("SUPORTE").Range("C234:C242").ClearContents

Worksheets("SUPORTE").Range("C247:C254").ClearContents

Worksheets("SUPORTE").Range("C257:C270").ClearContents

Worksheets("SUPORTE").Range("C273:C277").ClearContents

Worksheets("SUPORTE").Range("C280:C292").ClearContents

Worksheets("SUPORTE").Range("C299:C310").ClearContents

Worksheets("SUPORTE").Range("C313:C316").ClearContents

End Sub

Sub DestaqueEmNegrito()

Set wsSuporte = ThisWorkbook.Worksheets("SUPORTE")

Dim strNgrt As String

Dim intCel As Integer

For intCel = 1 To 325 '-> For intCel = 1 To 325

strNgrt = wsSuporte.Range("Q" & intCel).Text ' -> strNgrt = wsSuporte.Range("Q" & intCel).Text

doc.ActiveWindow.Selection.Find.ClearFormatting

With doc.ActiveWindow.Selection.Find

.Text = strNgrt

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

End With

doc.ActiveWindow.Selection.Find.Execute

doc.ActiveWindow.Selection.Font.Bold = True

If intCel > 2 And intCel < 19 Then '-------> If intCel > 2 And intCel < 19 Then

doc.ActiveWindow.Selection.Font.Underline = wdUnderlineSingle

End If

Next

intCel = 0

For intCel = 1 To 22 '-> For intCel = 1 To 12

strNgrt = wsSuporte.Range("R" & intCel).Text '-> strNgrt = wsSuporte.Range("R" & intCel).Text

doc.ActiveWindow.Selection.Find.ClearFormatting

With doc.ActiveWindow.Selection.Find

.Text = strNgrt

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

End With

doc.ActiveWindow.Selection.Find.Execute

doc.ActiveWindow.Selection.Font.Underline = wdUnderlineSingle

Next

intCel = 0

For intCel = 1 To 22 ' -> For intCel = 1 To 12

strNgrt = wsSuporte.Range("S" & intCel).Text ' -> strNgrt = wsSuporte.Range("S" & intCel).Text

doc.ActiveWindow.Selection.Find.ClearFormatting

With doc.ActiveWindow.Selection.Find

.Text = strNgrt

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

End With

doc.ActiveWindow.Selection.Find.Execute

doc.ActiveWindow.Selection.Font.Underline = wdUnderlineNone

doc.ActiveWindow.Selection.Font.Color = 16724787

Next

'---Centralizar

If frmDadosFormulario.optCFolha.Value = True Then

intCel = 0

For intCel = 1 To 3

strNgrt = wsSuporte.Range("Y" & intCel).Text ' -> strNgrt = wsSuporte.Range("Y" & intCel).Text

doc.ActiveWindow.Selection.Find.ClearFormatting

With doc.ActiveWindow.Selection.Find

.Text = strNgrt

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

End With

doc.ActiveWindow.Selection.Find.Execute

doc.ActiveWindow.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

If strNgrt = "DADOS CLIENTE E PROCESSO" Then

doc.ActiveWindow.Selection.ParagraphFormat.SpaceBefore = 12

doc.ActiveWindow.Selection.ParagraphFormat.SpaceAfter = 3

End If

Next

Else

strNgrt = wsSuporte.Range("Y3").Text '-> strNgrt = wsSuporte.Range("Y3").Text

doc.ActiveWindow.Selection.Find.ClearFormatting

With doc.ActiveWindow.Selection.Find

.Text = strNgrt

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

End With

doc.ActiveWindow.Selection.Find.Execute

doc.ActiveWindow.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter

End If

End Sub

Sub Desproteger()

Worksheets("SUPORTE").Visible = xlSheetVisible

End Sub

Sub Form()

fmrBusca.Show

End Sub

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...