Pido Ayuda

14/08/2005 - 17:44 por Jorge | Informe spam
Hola grupo! necesitaria saber cómo se puedo hacer para
que aparescan las propiedades de el libro con el que
estoy trabajando Como:nombre del
archivo,Titulo,asunto,autor,fecha de modificacion,tamaño.
En celdas de la hoja de Excel
Desde ya les agradezco por haber leído este post,
Saludos,
 

Leer las respuestas

#1 KL
14/08/2005 - 18:28 | Informe spam
Hola Jorge,

Podrias empezar con este codigo:

Sub test()
Dim p As DocumentProperty, i As Long, fs, f
i = 1
On Error Resume Next
For Each p In ThisWorkbook.BuiltinDocumentProperties
Cells(i, 1) = p.Name
Cells(i, 2) = p.Value
i = i + 1
Next p
i = i + 2
For Each p In ThisWorkbook.CustomDocumentProperties
Cells(i, 1) = p.Name
Cells(i, 2) = p.Value
i = i + 1
Next p
Cells(i + 1, 1) = "Nomre del archivo"
Cells(i + 1, 2) = ThisWorkbook.Name

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(ThisWorkbook.FullName)
Cells(i + 2, 1) = "Tamaño"
Cells(i + 2, 2) = f.Size
End Sub

Sub test2()
Dim fs, f
With ThisWorkbook
Cells(1, 1) = .BuiltinDocumentProperties(1).Name
Cells(1, 2) = .BuiltinDocumentProperties(1).Value
Cells(2, 1) = .BuiltinDocumentProperties(2).Name
Cells(2, 2) = .BuiltinDocumentProperties(2).Value
Cells(3, 1) = .BuiltinDocumentProperties(3).Name
Cells(3, 2) = .BuiltinDocumentProperties(3).Value
Cells(4, 1) = .BuiltinDocumentProperties(12).Name
Cells(4, 2) = .BuiltinDocumentProperties(12).Value
Cells(5, 1) = "Nomre del archivo"
Cells(5, 2) = .Name

Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(.FullName)
Cells(6, 1) = "Tamaño"
Cells(6, 2) = f.Size
End With
End Sub

Saludos,
KL


"Jorge" wrote in message
news:004601c5a0e7$11271270$
Hola grupo! necesitaria saber cómo se puedo hacer para
que aparescan las propiedades de el libro con el que
estoy trabajando Como:nombre del
archivo,Titulo,asunto,autor,fecha de modificacion,tamaño.
En celdas de la hoja de Excel
Desde ya les agradezco por haber leído este post,
Saludos,

Preguntas similares