Automation Error with BuiltinDocumentProperties

R

RyanH

I am getting an error: Automation Error. Can the BuiltinDocumentProperties
only be used with ThisWorkbook? I can't get it to work with the workbook
wbkDataSource.

If wbkDataSource.BuiltinDocumentProperties("Last Save Time") + TimeSerial(0,
10, 0) < Date Then
'do something
End If

Any ideas?
 
G

Gord Dibben

Dim wbkdatsource As Workbook
Set wbkDataSource = ThisWorkbook


Gord Dibben MS Excel MVP
 
P

Per Jessen

Hi Ryan

The problem is that for some reason you can not get the value of
BuiltinDocumentProperties on some machines, though you can on other
machines with same softvware.

Maybe you can use this:

If FileDateTime(wbkDataSource.FullName) + TimeSerial(0, 10, 0) < Date
Then
'do something
End If

Regards,
Per
 
R

RyanH

That works beautifullly. For some reason my original code would work with
ThisWorkbook, but the problem is that the code I want to run is not in
wbkSourceData. I'm not sure why Microsoft won't allow you to use
ActiveWorkbook or a Object Variable, weird.

Thanks!
--
Cheers,
Ryan


Per Jessen said:
Hi Ryan

The problem is that for some reason you can not get the value of
BuiltinDocumentProperties on some machines, though you can on other
machines with same softvware.

Maybe you can use this:

If FileDateTime(wbkDataSource.FullName) + TimeSerial(0, 10, 0) < Date
Then
'do something
End If

Regards,
Per
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top