Visual Basic - Ayuda Urgente!!!!! con Excel!!!!!!!

Life is soft - evento anual de software empresarial
 
Vista:

Ayuda Urgente!!!!! con Excel!!!!!!!

Publicado por Raymond Calderon (1 intervención) el 22/02/2006 19:32:47
Buenas mi pregunta es esta:

tomo un archivo que esta en el PC llamado exp2 exp3.......expn,
para el ejemplo sera exp2,

hago las modificaciones necesarias y a la hora de guardarlo lo guardo como=
"nombre del cliente + EXP2.xls" y cuando cambio otro nuevo y lo guardo con otro nombre me cambia a todos los que hice anteriormente... este es el codigo... me podrian ayudar diciendome cual es el error?

Gracias...

CODIGO=

Public Sub exp2()
Dim i As Integer
Dim char As String * 1
Dim nvo As String
Dim objExcel As Excel.Application
Set objExcel = New Excel.Application
objExcel.Workbooks.Open ("\\Kristhyn\software\Archivos\exp\EXP2.xls")
objExcel.Sheets("Hoja1").Select
' selecciono la hoja a la que quiero cambiarle el nombre
With objExcel
.Range("E1").Select
.ActiveCell.FormulaR1C1 = info.fm
.Range("C7").Select
.ActiveCell.FormulaR1C1 = info.Reserva
.Range("C19").Select
.ActiveCell.FormulaR1C1 = info.Cliente
.Range("C21").Select
.ActiveCell.FormulaR1C1 = info.descrip
.Range("C23").Select
.ActiveCell.FormulaR1C1 = info.transito
.Range("C25").Select
.ActiveCell.FormulaR1C1 = info.peso
.Range("F25").Select
.ActiveCell.FormulaR1C1 = info.volumen
If info.lcl = "1" Then
.Range("c25").Select
.ActiveCell.FormulaR1C1 = info.usd
Else
.Range("c26").Select
.ActiveCell.FormulaR1C1 = info.eur
End If
.Range("a45").Select
.ActiveCell.FormulaR1C1 = Sello.nombre
.Range("a46").Select
.ActiveCell.FormulaR1C1 = Sello.empresa
.Range("a47").Select
.ActiveCell.FormulaR1C1 = "Tel.: " & Sello.telefonos
.Range("a48").Select
.ActiveCell.FormulaR1C1 = "Fax.: " & Sello.fax
.Range("a49").Select
.ActiveCell.FormulaR1C1 = "E-Mail: " & Sello.mail
End With
i = Len(info.Cliente)
char = Mid(info.Cliente, i, 1)
While char = " "
i = i - 1
char = Mid(info.Cliente, i, 1)
Wend
nvo = Mid(info.Cliente, 1, i)
objExcel.SaveWorkspace nvo & " EXP2.xls"
objExcel.Workbooks.Close
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder