View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default How do I get the file properties?

Guy,

It's not in position 5 on my computer... which raises an interesting
problem.
Looks like if you want to use both, you may have to do lanuage checks up
front.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Guy Cohen" wrote in message
...
Hi Rob
Thank you for the reply.
I was just about to post that I found it :)
However - my code is a bit different than yours.
I use:
xlsApp.ActiveWorkbook.CustomDocumentProperties(5)
To get the client.
My Excel is in Hebrew so if I reference ("Client") I get an error.
However if I write the Hebrew word for client I get the client OK.

So my new question is- Will "Client" always stay he
CustomDocumentProperties(5)
??

TIA
Guy

‏‏"Rob van Gelder" כתב בהודעה
...
Guy,

Here's an Excel way of doing it.

Sub test()
Dim strSubject As String, strAuthor As String, strClient As String

On Error Resume Next
With ActiveWorkbook.BuiltinDocumentProperties
strSubject = .Item("Subject").Value
strAuthor = .Item("Author").Value
End With
With ActiveWorkbook.CustomDocumentProperties
strClient = .Item("Client").Value
End With
On Error GoTo 0

MsgBox "Subject: " & strSubject & vbNewLine & _
"Author: " & strAuthor & vbNewLine & _
"Client: " & strClient
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Guy Cohen" wrote in message
...
Hi all,

I use VB6 to read/fill an Excel file.
I would like to get the properties of the file.

The fields I need a
From Excel:When you click "File"-"Properties" you have:
Subject + Author on the second tab.
Client on the fifth tab.

Please advise.

Guy