Exportar archivo de excel a Word
Publicado por juanco (29 intervenciones) el 17/09/2008 16:10:54
Necesito una macro que tome unas celdas de excel y cree un archivo en word, tengo este pero el asunto es que me lo da en tabla y lo necesito en formato corriente de word:
Dim apliword As Object
Dim nume As Double
Dim ape1 As String
Dim ape2 As String
Dim nomb As String
Dim tedo As String
Set apliword = CreateObject("word.application")
With apliword
.documents.Add
.Visible = True
nume = Worksheets("Evaluador").[a5]
ape1 = Worksheets("Evaluador").[b5]
ape2 = Worksheets("Evaluador").[c5]
nomb = Worksheets("Evaluador").[d5]
tedo = "nume&ape1&ape2&nomb"
Worksheets("Evaluador").[a5:d5].Copy
.Selection.typeparagraph
.Selection.pasteexceltable linkedtoexcel:=False, wordformatting:=True, RTF:=False
.activedocument.SaveAs ("C:Documents and SettingsPsicologiaMis documentosJuan CarlosAccesando edo.doc")
.Selection.WholeStory
.Selection.Copy
Range("b1").Select
ActiveSheet.Paste
End With
apliword.Quit
End Sub
Dim apliword As Object
Dim nume As Double
Dim ape1 As String
Dim ape2 As String
Dim nomb As String
Dim tedo As String
Set apliword = CreateObject("word.application")
With apliword
.documents.Add
.Visible = True
nume = Worksheets("Evaluador").[a5]
ape1 = Worksheets("Evaluador").[b5]
ape2 = Worksheets("Evaluador").[c5]
nomb = Worksheets("Evaluador").[d5]
tedo = "nume&ape1&ape2&nomb"
Worksheets("Evaluador").[a5:d5].Copy
.Selection.typeparagraph
.Selection.pasteexceltable linkedtoexcel:=False, wordformatting:=True, RTF:=False
.activedocument.SaveAs ("C:Documents and SettingsPsicologiaMis documentosJuan CarlosAccesando edo.doc")
.Selection.WholeStory
.Selection.Copy
Range("b1").Select
ActiveSheet.Paste
End With
apliword.Quit
End Sub
Valora esta pregunta


0