Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default DocumentProperty of .csv file is Nothing

Hi folks,
for to load a .csv file into a worksheet just and only
when it was changed before, I need the date and
time when change happened.

For to find out which property-item contains the data I need,
I used this routine:

Dim x, y
Dim p As DocumentProperty

workbooks(3).activate
For Each p In ActiveWorkbook.CustomDocumentProperties
x = p.Name
y = p.Value
Next

It doesn't work because p contains "Nothing". Any hints
available how I can "set" p? Getting it pointing - to the
right place?

Regards
Peter Ostermann

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default DocumentProperty of .csv file is Nothing

Hi Peter,
I think the csv file is a text file which cannot store the properties like
..xls files can.
Hence you get p pointing to nothing.


"Peter Ostermann" wrote:

Hi folks,
for to load a .csv file into a worksheet just and only
when it was changed before, I need the date and
time when change happened.

For to find out which property-item contains the data I need,
I used this routine:

Dim x, y
Dim p As DocumentProperty

workbooks(3).activate
For Each p In ActiveWorkbook.CustomDocumentProperties
x = p.Name
y = p.Value
Next

It doesn't work because p contains "Nothing". Any hints
available how I can "set" p? Getting it pointing - to the
right place?

Regards
Peter Ostermann


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default DocumentProperty of .csv file is Nothing

Peter,
As Alok pointed out, these properties are not available to text files, only
file types that support OLE storage.
You would have to store additional data in the actual file as data or read
the standard Windows file info; LastModifieddate etc..

Which properties do you require ?

NickHK

"Peter Ostermann" wrote in message
...
Hi folks,
for to load a .csv file into a worksheet just and only
when it was changed before, I need the date and
time when change happened.

For to find out which property-item contains the data I need,
I used this routine:

Dim x, y
Dim p As DocumentProperty

workbooks(3).activate
For Each p In ActiveWorkbook.CustomDocumentProperties
x = p.Name
y = p.Value
Next

It doesn't work because p contains "Nothing". Any hints
available how I can "set" p? Getting it pointing - to the
right place?

Regards
Peter Ostermann



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default DocumentProperty of .csv file is Nothing

Hi NickHK, hi Alok,

..... got it functionating. See code below.

"NickHK" schrieb im Newsbeitrag
...
Peter,
As Alok pointed out, these properties are not available to text files,
only
file types that support OLE storage.
You would have to store additional data in the actual file as data or read
the standard Windows file info; LastModifieddate etc..

Which properties do you require ?

NickHK


Private Function lastModified(path) As String
Dim objFSO As Object
Dim objFile As Object

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(path)

lastModified = objFile.DateLastModified
End Function

Thanks to both of you for feedback.

Best Regards
Peter Ostermann

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DocumentProperty Peter Karlström Excel Worksheet Functions 5 November 5th 07 04:27 PM
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
I SAVED A FILE OVER ANOTHER A FILE IN EXCEL. THE OLD FILE WAS AN . DUFFER8MCD Excel Discussion (Misc queries) 1 December 23rd 04 11:32 PM
i received a file that reads powerpoint document file file exten. CCAROLACEREC Excel Discussion (Misc queries) 1 December 4th 04 05:02 PM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"