Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default error with user defined

I am trying to display the properties of a file.
But I keep getting a "user-defined" error on the
Dim DSO As..........line of the macro.
Can someone correct me please?
--------------------------
Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As DSOleFile.PropertyReader
Set DSO = New DSOleFile.PropertyReader
FileName = "D:\Sitem_Excel\motor.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default error with user defined

Hi Martyn,

Try this late binding version

Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As Object
Set DSO = CreateObject("DSOleFile.PropertyReader")
FileName = "c:\myTest\volker1.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Martyn" wrote in message
...
I am trying to display the properties of a file.
But I keep getting a "user-defined" error on the
Dim DSO As..........line of the macro.
Can someone correct me please?
--------------------------
Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As DSOleFile.PropertyReader
Set DSO = New DSOleFile.PropertyReader
FileName = "D:\Sitem_Excel\motor.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default error with user defined

Hi Bob,
Thanks for the answer. But using your suggestion I get a "Run-time error
'429': ActiveX component can't create object error" this time. By the way I
am using XL 2000 with WindowsXP.

"Bob Phillips" wrote in message
...
Hi Martyn,

Try this late binding version

Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As Object
Set DSO = CreateObject("DSOleFile.PropertyReader")
FileName = "c:\myTest\volker1.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default error with user defined

Have you downloaded the DSO dll, installed it and registered it?

If not, thats your huckleberry.

http://support.microsoft.com/?id=224351

set the section "Steps to Setup and Test"

--
Regards,
Tom Ogilvy

"Martyn" wrote in message
...
Hi Bob,
Thanks for the answer. But using your suggestion I get a "Run-time error
'429': ActiveX component can't create object error" this time. By the way

I
am using XL 2000 with WindowsXP.

"Bob Phillips" wrote in message
...
Hi Martyn,

Try this late binding version

Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As Object
Set DSO = CreateObject("DSOleFile.PropertyReader")
FileName = "c:\myTest\volker1.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default error with user defined

Thanks Tom, I managed to install the *.dll but fail to test it. Couse I
haven't got VB5 or VB6 on my PC. Anyway I do not get any errors now when I
run the macro but I ain't getting any Properties either on myscreen?


"Tom Ogilvy" wrote in message
...
Have you downloaded the DSO dll, installed it and registered it?

If not, thats your huckleberry.

http://support.microsoft.com/?id=224351

set the section "Steps to Setup and Test"

--
Regards,
Tom Ogilvy

"Martyn" wrote in message
...
Hi Bob,
Thanks for the answer. But using your suggestion I get a "Run-time error
'429': ActiveX component can't create object error" this time. By the

way
I
am using XL 2000 with WindowsXP.

"Bob Phillips" wrote in message
...
Hi Martyn,

Try this late binding version

Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As Object
Set DSO = CreateObject("DSOleFile.PropertyReader")
FileName = "c:\myTest\volker1.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default error with user defined

Martyn,

The code is outputting the results to the VBE immediate window.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Martyn" wrote in message
...
Thanks Tom, I managed to install the *.dll but fail to test it. Couse I
haven't got VB5 or VB6 on my PC. Anyway I do not get any errors now when I
run the macro but I ain't getting any Properties either on myscreen?


"Tom Ogilvy" wrote in message
...
Have you downloaded the DSO dll, installed it and registered it?

If not, thats your huckleberry.

http://support.microsoft.com/?id=224351

set the section "Steps to Setup and Test"

--
Regards,
Tom Ogilvy

"Martyn" wrote in message
...
Hi Bob,
Thanks for the answer. But using your suggestion I get a "Run-time

error
'429': ActiveX component can't create object error" this time. By the

way
I
am using XL 2000 with WindowsXP.

"Bob Phillips" wrote in message
...
Hi Martyn,

Try this late binding version

Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As Object
Set DSO = CreateObject("DSOleFile.PropertyReader")
FileName = "c:\myTest\volker1.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default error with user defined

I'll check that and turn back here to comment Bob. Thanks for the info...

"Bob Phillips" wrote in message
...
Martyn,

The code is outputting the results to the VBE immediate window.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Martyn" wrote in message
...
Thanks Tom, I managed to install the *.dll but fail to test it. Couse I
haven't got VB5 or VB6 on my PC. Anyway I do not get any errors now when

I
run the macro but I ain't getting any Properties either on myscreen?


"Tom Ogilvy" wrote in message
...
Have you downloaded the DSO dll, installed it and registered it?

If not, thats your huckleberry.

http://support.microsoft.com/?id=224351

set the section "Steps to Setup and Test"

--
Regards,
Tom Ogilvy

"Martyn" wrote in message
...
Hi Bob,
Thanks for the answer. But using your suggestion I get a "Run-time

error
'429': ActiveX component can't create object error" this time. By

the
way
I
am using XL 2000 with WindowsXP.

"Bob Phillips" wrote in message
...
Hi Martyn,

Try this late binding version

Private Sub Workbook_Open()
Dim FileName As String
Dim DSO As Object
Set DSO = CreateObject("DSOleFile.PropertyReader")
FileName = "c:\myTest\volker1.xls"
With DSO.GetDocumentProperties(sfilename:=FileName)
Debug.Print .AppName
Debug.Print .Author
Debug.Print .ByteCount
Debug.Print .Company
Debug.Print .Title
Debug.Print .Subject
Debug.Print .Author
Debug.Print .Category
Debug.Print .Keywords
Debug.Print .Comments
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)











  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default error with user defined

Bob thank you ...You were correct. It displays the results to the VBE
immediate window.

"Bob Phillips" wrote in message
...
Martyn,

The code is outputting the results to the VBE immediate window.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




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
#NAME? Error With User Defined Functions Thomas M. Excel Worksheet Functions 7 January 5th 10 01:39 AM
vlookup, add parameter, on error return user defined value jims2994 Excel Worksheet Functions 0 July 7th 06 02:56 PM
"User-defined type not defined" message in Excel RW1946 Excel Discussion (Misc queries) 0 August 31st 05 12:14 PM
#Name? Error in User Defined VB Function idgity Excel Worksheet Functions 2 August 30th 05 08:58 PM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM


All times are GMT +1. The time now is 04:58 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"