×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SW Custom Property Linking in Excel's VB
11

SW Custom Property Linking in Excel's VB

SW Custom Property Linking in Excel's VB

(OP)
I am not a programmer at all, however I have managed to create myself and my company a quick and easy way of tracking our drawings. I simply created a spreadsheet in Excel that automatically updates on open & lists all files in our drawing vault folder by their filename and adds a hyperlink to each of these files. I now want to add the corresponding description, customer name & project # from the custom properties of each of the solidworks files so that they will display in the spreadsheet also, therefore giving us a means of finding our documents without knowing the exact part number. Right now, I have the spreadsheet working so that column A lists the files and hyperlinks them, column B lists the Last Modified Date & column C shows the file path. Column D heading shows Description, Column E heading shows Customer & Column F shows Project, just like they should. However I do not understand how I can retrieve the custom property values and have them added into my spreadsheet. If anybody could help, that would be awesome. Here is my code so far:

Private Sub WORKBOOK_OPEN()
     ' Searches the selected folders and sub folders for files with the specified
     'extension.  .xls, .doc, .ppt, etc.
     'A new worksheet is produced called "File Search Results".  You can click on the link and go directly
     'to the file you need.
    Dim i As Long, z As Long, Rw As Long
    Dim ws As Worksheet
    Dim y As Variant
    Dim fLdr As String, Fil As String, FPath As String
    
    y = "*.*"
    If y = False And Not TypeName(y) = "STRING" Then Exit Sub
    Application.ScreenUpdating = False

           '**********************************************************************
     'fLdr = BrowseForFolderShell
    fLdr = "P:\DRAWING_VAULT"
    
     '**********************************************************************
    With Application.FileSearch
        .NewSearch
        .LookIn = fLdr
        .SearchSubFolders = False
        .Filename = y
        Set ws = ThisWorkbook.Worksheets.Add(Sheets(1))
        On Error GoTo 1
2:                      ws.Name = "TMC_DRAWING_LIST"
        On Error GoTo 0
        If .Execute() > 0 Then
            For i = 1 To .FoundFiles.Count
                Fil = .FoundFiles(i)
                 'Get file path from file name
                FPath = Left(Fil, Len(Fil) - Len(Split(Fil, "\")(UBound(Split(Fil, "\")))) - 1)
                If Left$(Fil, 1) = Left$(fLdr, 1) Then
                    If CBool(Len(Dir(Fil))) Then
                        z = z + 1
                        ws.Cells(z + 1, 1).Resize(, 6) = _
                        Array(Dir(Fil), _
                        FileDateTime(Fil), _
                        FPath, _
                        '***this is where I would assume I need to add the callouts for description, customer & project**
                        )


                                                           
                        ws.Hyperlinks.Add Anchor:=Cells(z + 1, 1), _
                        Address:=.FoundFiles(i)
                    End If
                End If
            Next i
        End If
    End With
     
    ActiveWindow.DisplayHeadings = False
     
    With ws
        Rw = .Cells.Rows.Count
        With .[A1:F1]
            .Value = [{"FILE NAME (CLICK TO OPEN)","LAST MODIFIED", "PATH"," FILE DESCRIPTION","CUSTOMER","PROJECT/WORKORDER NO."}]
            .Font.ColorIndex = vbBlack
            .Font.Bold = True
            .Font.Size = 11
            .Cells.Interior.Color = vbGreen
            .EntireColumn.AutoFit
            .HorizontalAlignment = xlCenter
        End With
        .[G1:IV1 ].EntireColumn.Hidden = True
        On Error Resume Next
        Range(Cells(Rw, "A").End(3)(2), Cells(Rw, "A")).EntireRow.Hidden = True
        Range(.[A2 ], Cells(Rw, "C")).Sort [A2 ], xlAscending, Header:=xlNo
    End With
     
    Application.ScreenUpdating = True
    Exit Sub
1:          Application.DisplayAlerts = False
    Worksheets("TMC_DRAWING_LIST").Delete
    Application.DisplayAlerts = True
    GoTo 2
End Sub


   









RE: SW Custom Property Linking in Excel's VB

I do not have an answer for you, but I am wandering why you are not using PDM?

Bradley
SolidWorks Premim 2007 x64 SP4.0
PDM Works, Intel(R) Pentium(R) D CPU
3.00 GHz, 4 GB RAM, Virtual memory 12577 MB, nVidia 3400

RE: SW Custom Property Linking in Excel's VB

3
You need to use either dsofile.dll or swDocumentMgr.dll function calls.  DSOfile might be a little faster, but I'm really not sure.  If you'll use the Google search on these forums for DSOfile you should be able to find enough to get you started.  Good luck!

RE: SW Custom Property Linking in Excel's VB

2
(OP)
We don't have PDMworks on all of our machines, so it doesn't make sense to use it. Plus, we are a very small shop, so the extra 10g's or whatever it is to upgrade to office pro doesn't make sense for us. If I can get this last portion of the code working, this is just as good for us as PDM would be. We don't have that many files, but enough that we need to track them. I'll try to check out the DSOfile. Thanks.

RE: SW Custom Property Linking in Excel's VB

You don't need active on all of your machines.  You just need a single site license or two to share between your systems.  I highly recommend looking into using PDMWorks as your engineering department rev control and file storage because on what you've described here.

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group

RE: SW Custom Property Linking in Excel's VB

Correction: "You don't need PMDWorks active on all of your machines.  You just need a single site license or two to share between your systems.  I highly recommend looking into using PDMWorks as your engineering department rev control and file storage, based on what you've described here."  too early in the morning here lol

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group

RE: SW Custom Property Linking in Excel's VB

(OP)
I have looked at PDM works and it doesn't look that great to be honest. I want a simple list that I can go to and sort quickly in order to find what document I am looking for. We use our drawing numbers as filenames, so by looking at the file in a folder, there is no way to tell what it unless you open SW. Using the spreadsheet, we can sort by customer, description, etc to find what file we are looking for then just click the hyperlink to open the document. PDMworks is overkill for what we are using it for. Somebody please let me know if you have any suggestions on the exact code that I would need to add to my code above to have it list the custom properties I mentioned in my first posting. Thanks!

RE: SW Custom Property Linking in Excel's VB

Well, it should really be said that it appears you are trying to re-invent the wheel.  It sounds like you are trying to make a basic PLM with a small macro.  This is like Agile, Oracle, PeopleSoft, SAP, etc.  There's a reason why these companies exist. :)  Making PLM's it's not easy to do.  Anyways, Good Luck!

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
sw.fcsuper.com
Co-moderator of Solidworks Yahoo! Group

RE: SW Custom Property Linking in Excel's VB

Matt, well said.
I am so glad we are using PDM. A star for you.

Bradley
SolidWorks Premim 2007 x64 SP4.0
PDM Works, Intel(R) Pentium(R) D CPU
3.00 GHz, 4 GB RAM, Virtual memory 12577 MB, nVidia 3400

RE: SW Custom Property Linking in Excel's VB

4
What's wrong with you guys? The man asked a simple question, you don't have an answer but you keep telling him how stupid he is because he thinks different than you do. Are you trying to chase him away from this forum?

RE: SW Custom Property Linking in Excel's VB

(OP)
I was wondering the same thing.....I just want to get some help on my problem. I have heard the same story about PDMworks from our annoying reseller a thousand times. If anybody could help me, it would be greatly appreciated. Once I have it working, I would be more than happy to post it for whoever may be able to utilize as well (perhaps for those who don't have PDMworks). Thanks folks.

RE: SW Custom Property Linking in Excel's VB

As mentioned in handleman’s first post swDocumentManager.dll is an alternative to DSOfile.dll.  They have different calls and different functionality, but both should be able to accomplish what you want.

If you are only going to be opening this spreadsheet on computers with SolidWorks and you do not want to install DSOfile.dll on them you could use the swDocumentManager.dll that is installed with SolidWorks explorer.  See thread559-175535: searching for a configuration specific custom properties in SolidWorks for the chunk of code by handleman.  It should be a good starting point.  If you are using a version of SolidWorks prior to 2007, you will need to e-mail SolidWorks API tech support to get a key to make it work.  As in handleman’s example, you would also have access to configuration specific custom properties.

Personally I would use DSOfile.dll since you do not appear to need the configuration specific properties.

Eric

RE: SW Custom Property Linking in Excel's VB

(OP)
Well I have finally got it working a little more. As you will see in my code below, I have sorted out the DSOfile side of it, however I need to now tie that into my array. Right now, my array will only list the custom properties of the file I have named with an absolute path as I point out in my code. How do I change the code so I can make sure that fil = each file in the array so that my excel list will list the data corresponding to each file. Please help me out.

Sub WORKBOOK_OPEN()
     
     
    Dim i As Long, z As Long, Rw As Long
    Dim ws As Worksheet
    Dim y As Variant
    Dim fLdr As String
    Dim fil As String
    Dim DSO As DSOFile.OleDocumentProperties
    Dim FPath As String
    Set DSO = New DSOFile.OleDocumentProperties
    fil = "I HAVE TO PUT AN ABSOLUTE FILE PATH HERE"
    DSO.Open SFileName:=fil
    Dim Object As String
    Set OBJFILE = CreateObject("DSOFile.OleDocumentProperties")
    y = "*.*"
    If y = False And Not TypeName(y) = "STRING" Then Exit Sub
    Application.ScreenUpdating = False

           '**********************************************************************
     'fLdr = BrowseForFolderShell
    fLdr = "P:\DRAWING_VAULT"
    
     '**********************************************************************
    
    With Application.FileSearch
        .NewSearch
        .LookIn = fLdr
        .SearchSubFolders = False
        .FileName = y
       
        Set ws = ThisWorkbook.Worksheets.Add(Sheets(1))
        On Error GoTo 1
2:      ws.Name = "TMC DRAWING LIST"
                
        On Error GoTo 0
        If .Execute() > 0 Then
            For i = 1 To .FoundFiles.Count
                fil = .FoundFiles(i)
                'Get file path from file name
                
                FPath = Left(fil, Len(fil) - Len(Split(fil, "\")(UBound(Split(fil, "\")))) - 1)
                If Left$(fil, 1) = Left$(fLdr, 1) Then
                    If CBool(Len(Dir(fil))) Then
                        z = z + 1
                        ws.Cells(z + 1, 1).Resize(, 8) = _
                        Array(Dir(fil), _
                        DSO.SummaryProperties.DateLastSaved, _
                        DSO.CustomProperties.Item("DESCRIPTION").Value, _
                        DSO.CustomProperties.Item("CUSTOMER").Value, _
                        DSO.CustomProperties.Item("PROJECT").Value, _
                        DSO.CustomProperties.Item("USERDEFINED1").Value, _
                        DSO.CustomProperties.Item("USERDEFINED2").Value, _
                        DSO.CustomProperties.Item("DRAWNBY").Value)
                                                                                     
                                                 
                        ws.Hyperlinks.Add Anchor:=Cells(z + 1, 1), _
                        Address:=.FoundFiles(i)
                    End If
                End If
            Next i
        End If
    End With
     
    ActiveWindow.DisplayHeadings = False
     
    With ws
        Rw = .Cells.Rows.Count
        With .[A1:H1]
            .Value = [{"FILE NAME (CLICK TO OPEN)","LAST MODIFIED"," FILE DESCRIPTION","CUSTOMER","WORKORDER NO.","COMPUTER ID NO.","CUSTOMER DWG NO.","AUTHOR"}]
            .Font.ColorIndex = vbBlack
            .Font.Bold = True
            .Font.Size = 11
            .Cells.Interior.Color = vbGreen
            .EntireColumn.AutoFit
            .HorizontalAlignment = xlCenter
        End With
        .[I1:IV1 ].EntireColumn.Hidden = True
        On Error Resume Next
        Range(Cells(Rw, "A").End(3)(2), Cells(Rw, "A")).EntireRow.Hidden = True
        Range(.[A2 ], Cells(Rw, "C")).Sort [A2 ], xlAscending, Header:=xlNo
    End With
     
    Application.ScreenUpdating = True
    Exit Sub
1:          Application.DisplayAlerts = False
    Worksheets("TMC DRAWING LIST").Delete
    Application.DisplayAlerts = True
    GoTo 2
End Sub


   



RE: SW Custom Property Linking in Excel's VB

Just move the code that retrieves custom properties into the "for" loop.

RE: SW Custom Property Linking in Excel's VB

(OP)
I moved the code to the "for" loop and now it gives an error that says the property "description" does not exist. It was working before when I just gave it an absolute path for a filename.

RE: SW Custom Property Linking in Excel's VB

It will give that error when it comes across a file that doesn't have the description entered.  You'll have to test for the existence of each property before you try to access it.

RE: SW Custom Property Linking in Excel's VB

(OP)
how exactly is that done?! LOL

RE: SW Custom Property Linking in Excel's VB

Try replacing each

DSO.CustomProperties.Item("[name]")

with

iif(not DSO.CustomProperties.Item("[name]") is nothing, DSO.CustomProperties.Item("[name]").Value, "")


That's all one line.  It's sort of ugly programming, but it's the simplest way to fit it into your code.

Good luck!

RE: SW Custom Property Linking in Excel's VB

(OP)
tried it but it still gives me an error when one of the properties hasn't been filled in in a file (such as description). It won't return a blank value. I think this is the last issue too....if I can get this beat, my sheet will be up and running finally! Please any help would be great!

RE: SW Custom Property Linking in Excel's VB

Can you post your current code?

RE: SW Custom Property Linking in Excel's VB

(OP)
Sub WORKBOOK_OPEN()
     
     
    Dim i As Long, z As Long, Rw As Long
    Dim ws As Worksheet
    Dim y As Variant
    Dim fLdr As String
    Dim fil As String
    Dim DSO As DSOFile.OleDocumentProperties
    Dim FPath As String
    
    Dim Object As String
    Set OBJFILE = CreateObject("DSOFile.OleDocumentProperties")
    y = "*.*"
    If y = False And Not TypeName(y) = "STRING" Then Exit Sub
    Application.ScreenUpdating = False

           '**********************************************************************
     'fLdr = BrowseForFolderShell
    fLdr = "P:\DRAWING_VAULT"
    
     '**********************************************************************
    
    With Application.FileSearch
        .NewSearch
        .LookIn = fLdr
        .SearchSubFolders = False
        .FileName = y
       
        Set ws = ThisWorkbook.Worksheets.Add(Sheets(1))
        On Error GoTo 1
2:      ws.Name = "TMC DRAWING LIST"
                
        On Error GoTo 0
        If .Execute() > 0 Then
            For i = 1 To .FoundFiles.Count
                fil = .FoundFiles(i)
                Set DSO = New DSOFile.OleDocumentProperties
                DSO.Open SFileName:=fil
                'Get file path from file name
                
                FPath = Left(fil, Len(fil) - Len(Split(fil, "\")(UBound(Split(fil, "\")))) - 1)
                If Left$(fil, 1) = Left$(fLdr, 1) Then
                    If CBool(Len(Dir(fil))) Then
                        z = z + 1
                        ws.Cells(z + 1, 1).Resize(, 8) = _
                        Array(Dir(fil), _
                        DSO.SummaryProperties.DateLastSaved, _
                        IIf(Not DSO.CustomProperties.Item("description") Is Nothing, DSO.CustomProperties.Item("description").Value, ""), _
                        IIf(Not DSO.CustomProperties.Item("customer") Is Nothing, DSO.CustomProperties.Item("customer").Value, ""), _
                        IIf(Not DSO.CustomProperties.Item("project") Is Nothing, DSO.CustomProperties.Item("project").Value, ""), _
                        IIf(Not DSO.CustomProperties.Item("userdefined1") Is Nothing, DSO.CustomProperties.Item("userdefined1").Value, ""), _
                        IIf(Not DSO.CustomProperties.Item("userdefined2") Is Nothing, DSO.CustomProperties.Item("userdefined2").Value, ""), _
                        IIf(Not DSO.CustomProperties.Item("drawnby") Is Nothing, DSO.CustomProperties.Item("drawnby").Value, ""))
                                                                      
                        ws.Hyperlinks.Add Anchor:=Cells(z + 1, 1), _
                        Address:=.FoundFiles(i)
                    End If
                End If
            Next i
        End If
    End With
     
    ActiveWindow.DisplayHeadings = False
     
    With ws
        Rw = .Cells.Rows.Count
        With .[A1:H1]
            .Value = [{"FILE NAME (CLICK TO OPEN)","LAST MODIFIED"," FILE DESCRIPTION","CUSTOMER","WORKORDER NO.","COMPUTER ID NO.","CUSTOMER DWG NO.","AUTHOR"}]
            .Font.ColorIndex = vbBlack
            .Font.Bold = True
            .Font.Size = 11
            .Cells.Interior.Color = vbGreen
            .EntireColumn.AutoFit
            .HorizontalAlignment = xlCenter
        End With
        .[I1:IV1 ].EntireColumn.Hidden = True
        On Error Resume Next
        Range(Cells(Rw, "A").End(3)(2), Cells(Rw, "A")).EntireRow.Hidden = True
        Range(.[A2 ], Cells(Rw, "C")).Sort [A2 ], xlAscending, Header:=xlNo
    End With
     
    Application.ScreenUpdating = True
    Exit Sub
1:          Application.DisplayAlerts = False
    Worksheets("TMC DRAWING LIST").Delete
    Application.DisplayAlerts = True
    GoTo 2
End Sub


   









RE: SW Custom Property Linking in Excel's VB

Custom property names are case-sensitive.  Therefore "Description" doesn't equal "description"

RE: SW Custom Property Linking in Excel's VB

(OP)
checked/changed all of the property names to match, still having the same problem. Maybe the file doesn't actually have the "description" property unless it has a value applied to it. I am using another macro to add these custom properties before I run this spreadsheet list (the files do not automatically have these properties when the files are saved).

RE: SW Custom Property Linking in Excel's VB

OK, this should fix you.  I forgot a couple of things.  The first is that any attempt to access a non-existent collection member results in an error.  The second is that each statement of an IIF is evaluated regardless of the condition.  Anyway, what you need to do is replace each

IIf(Not DSO.CustomProperties.Item("[name]") Is Nothing, DSO.CustomProperties.Item("[name]").Value, "")

with

IsProp(DSO.CustomProperties, "[name]")

IsProp is a function I wrote that will check for existence of a property by name and return either the value or the words "Property Not Present".  You need to copy this function and paste it at the bottom of your code, outside the last "End Sub" statement.

CODE

Function IsProp(myCProps As Object, myMemName As String) As String
    Dim testProp As Object
    On Error Resume Next
    Set testProp = myCProps(myMemName)
    If testProp Is Nothing Then
        IsProp = "Property Not Present"
    Else
        IsProp = testProp.Value
    End If
    On Error GoTo 0
End Function

RE: SW Custom Property Linking in Excel's VB

(OP)
Awesome, thank you so much Handleman! By any change do you know how to automatically turn on autofilter in excel? It's about the only thing that I would like to add. Other than that, this is great. If anyone may be interested in the code, feel free to ask and I can post the latest and now working code!

RE: SW Custom Property Linking in Excel's VB

(OP)
I have tried
ws.EnableAutoFilter = True

but it doesn't seem to do anything. I am just trying to get the autofilter arrows to show up on worksheet open. Just so I dont have to go to Data > Filter > AutoFilter manually each time I open the excel file. Any suggestions?

RE: SW Custom Property Linking in Excel's VB

puds, I am interested in your code, please post it.

RE: SW Custom Property Linking in Excel's VB

I turned the AutoFilter on while recording a macro in Excel (a good way to find the VB code for menu choices).  The resulting code was:

CODE

Selection.AutoFilter

Eric

RE: SW Custom Property Linking in Excel's VB

(OP)
Here you go:

Sub WORKBOOK_OPEN()
        
    Dim i As Long, z As Long, Rw As Long
    Dim ws As Worksheet
    Dim y As Variant
    Dim fLdr As String
    Dim fil As String
    Dim DSO As DSOFile.OleDocumentProperties
    Dim FPath As String
    
    Dim Object As String
    Set OBJFILE = CreateObject("DSOFile.OleDocumentProperties")
    y = "*.*"
    If y = False And Not TypeName(y) = "STRING" Then Exit Sub
    Application.ScreenUpdating = False

           '**********************************************************************
     'fLdr = BrowseForFolderShell
    fLdr = "P:\DRAWING_VAULT" 'this is the folder where your drawings/files are contained
    
     '**********************************************************************
    
    With Application.FileSearch
        .NewSearch
        .LookIn = fLdr
        .SearchSubFolders = False 'you can search subfolders if you want
        .FileName = y
       
        Set ws = ThisWorkbook.Worksheets.Add(Sheets(1))
        On Error GoTo 1
2:      ws.Name = "TMC DRAWING LIST" 'call your sheet anything you like
        ws.EnableAutoFilter = True
        On Error GoTo 0
        If .Execute() > 0 Then
            For i = 1 To .FoundFiles.Count
                fil = .FoundFiles(i)
                Set DSO = New DSOFile.OleDocumentProperties
                DSO.Open SFileName:=fil
                'Get file path from file name
                
                FPath = Left(fil, Len(fil) - Len(Split(fil, "\")(UBound(Split(fil, "\")))) - 1)
                If Left$(fil, 1) = Left$(fLdr, 1) Then
                    If CBool(Len(Dir(fil))) Then
                        z = z + 1
                        ws.Cells(z + 1, 1).Resize(, 8) = _
                        Array(Dir(fil), _
                        DSO.SummaryProperties.DateLastSaved, _
                        IsProp(DSO.CustomProperties, "Description"), _
                        IsProp(DSO.CustomProperties, "Customer"), _
                        IsProp(DSO.CustomProperties, "Project"), _
                        IsProp(DSO.CustomProperties, "UserDefined1"), _
                        IsProp(DSO.CustomProperties, "UserDefined2"), _
                        IsProp(DSO.CustomProperties, "DrawnBy"))


                                                                      
                        ws.Hyperlinks.Add Anchor:=Cells(z + 1, 1), _
                        Address:=.FoundFiles(i)
                    End If
                End If
            Next i
        End If
    End With
     
    ActiveWindow.DisplayHeadings = False
     
    With ws
        Rw = .Cells.Rows.Count
        With .[A1:H1]
            .Value = [{"FILE NAME (CLICK TO OPEN)","LAST MODIFIED"," FILE DESCRIPTION","CUSTOMER","WORKORDER NO.","COMPUTER ID NO.","CUSTOMER DWG NO.","AUTHOR"}]
            .Font.ColorIndex = vbBlack
            .Font.Bold = True
            .Font.Size = 11
            .Cells.Interior.Color = vbGreen
            .EntireColumn.AutoFit
            .HorizontalAlignment = xlCenter
        End With
        .[I1:IV1 ].EntireColumn.Hidden = True
        On Error Resume Next
        Range(Cells(Rw, "A").End(3)(2), Cells(Rw, "A")).EntireRow.Hidden = True
        Range(.[A2 ], Cells(Rw, "C")).Sort [A2 ], xlAscending, Header:=xlNo
    End With
     
    Application.ScreenUpdating = True
    Exit Sub
1:          Application.DisplayAlerts = False
    Worksheets("TMC DRAWING LIST").Delete
    Application.DisplayAlerts = True
    GoTo 2
End Sub

Function IsProp(myCProps As Object, myMemName As String) As String
    Dim testProp As Object
    On Error Resume Next
    Set testProp = myCProps(myMemName)
    If testProp Is Nothing Then
        IsProp = "N/A"
    Else
        IsProp = testProp.Value
    End If
    On Error GoTo 0
End Function
   









RE: SW Custom Property Linking in Excel's VB

Thanks puds. A star for you for your effort and a star for handleman for his help. We would be lost without him.

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman,
I have one more glich I need to get rid of, hopefully you or someone else can help. When I am opening my spreadsheet, if someone else on the network has one of the files open that would be included in my list of files in my spreadsheet, I get a path/file access error and my spreadsheet doesn't update or display properly. From what I understand, I need to use the dso read only option or something along those lines, I am just unsure of the exact code and placement in my current code for this to work effectively. Any help would be great!! Thanks again!

RE: SW Custom Property Linking in Excel's VB

You should just be able to change the line

DSO.Open SFileName:=fil

to

DSO.Open SFileName:=fil, True

and that should do it.

RE: SW Custom Property Linking in Excel's VB

(OP)
It didn't work - I am getting an error:

compile error - expected named parameter

(it highlights "true")

RE: SW Custom Property Linking in Excel's VB

Sorry, I don't use the named parameters very much, but I'm guessing that if one parameter is named they all have to be named.  So you would need to use

DSO.Open SFileName:=fil, ReadOnly:=True

Basically, the lines "DSO.Open fil, True" and "DSO.Open SFileName:=fil, ReadOnly:=True" are exactly the same.  The second one just specifies the name of the argument along with its value.  The first relies on the order of arguments to determine which is which.

RE: SW Custom Property Linking in Excel's VB

(OP)
I am still getting a path/file access error - how can I add the dsooptionopenreadonlyifnowriteaccess line? Maybe that will help?

RE: SW Custom Property Linking in Excel's VB

(OP)
I tried
DSO.Open SFileName:=fil, ReadOnly:=True, dsofileoptions:=dsoOptionOpenReadOnlyIfNoWriteAccess

and received error 'named argument not found'

RE: SW Custom Property Linking in Excel's VB

Try:
DSO.Open SFileName:=fil, ReadOnly:=True, dsoFileOpenOptions:=dsoOptionOpenReadOnlyIfNoWriteAccess

RE: SW Custom Property Linking in Excel's VB

(OP)
tried it.....got named argument not found and it highlights the dsofileopenoptions code

RE: SW Custom Property Linking in Excel's VB

Whoops, sorry, I misread my object browser.  It's just

DSO.Open SFileName:=fil, ReadOnly:=True, Options:=dsoOptionOpenReadOnlyIfNoWriteAccess

RE: SW Custom Property Linking in Excel's VB

(OP)
perfect....works like a charm. Thank you so much....AGAIN! This little spreadsheet is saving us so much time, it's great. The only thing I am thinking about doing differently is having it so you open the spreadsheet and it shows the sheet that was last saved. Then you can hit a button if you want it to update. That way it will save sometime when opening. Is this a simple change?

RE: SW Custom Property Linking in Excel's VB

(OP)
well i just moved the code from workbook to a new module and added the macro toolbar to excel. Now I can just save the spreadsheet when it closes and next time I open it, it will be how it was at its last save. I can hit the run macro button to update it now. Does this seem okay to you or is there a better way of doing it? I would like to have an "UPDATE DRAWING LIST" button appear when the spreadsheet opens that will run the macro when it is clicked. Is there a way to do this?

RE: SW Custom Property Linking in Excel's VB

(OP)
actually forget about my last post - someone here thought it would be a good idea to automatically run the macro and save the spreadsheet when you close the workbook. That way when you open it again, it will be updated (unless someone else added files between the last close and the opening). Anyways, I think this may be a good way to do it. Any ideas?

RE: SW Custom Property Linking in Excel's VB

(OP)
Well the autosave on close is a good idea, however it causes a slight problem if someone else has the spreadsheet open at the same time. If I have the file open and then another user open it and closes it while I have the write version open, his will crash with an error because it doesnt have write access to update and then save the file since I have it open. Anybody have any better suggestions on doing this? The only reason I didn't leave the update on open is because with more files being created everyday, it takes longer and longer to open the spreadsheet and update. Is there anyway to make it realtime updateable?

RE: SW Custom Property Linking in Excel's VB

Why not update it every night with a scheduled task or script?  You could use VBScript to un-read-onlify the file, open it, run the update, save, close, and re-read-onlify it again.  Then, just have some computer run that task at midnight or something.

RE: SW Custom Property Linking in Excel's VB

(OP)
Is there a way to have each of the users only be able to open a read only copy of the file and have the writeable copy on a timed interval to update and then save itself again? If so, is there also a way so that the read only copies will refresh everytime the writeable version updates, even if the user currently has the read only copy open for viewing?

I guess what I would really like to happen is to have the file as a viewing file only with the ability to update at timed intervals by a writeable version running in the background or something along those lines. Any ideas?

RE: SW Custom Property Linking in Excel's VB

I would probably make the original file to be read-only.  Then, you can add the following block of code at the beginning of the WORKBOOK_OPEN() sub:

CODE

If ActiveWorkbook.ReadOnly Then
    MsgBox "Sheet last updated " & ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
    Exit Sub
End If

This will stop the main update code from running if the file was opened read-only.  Having the file open read-only will keep the original file available for periodic updating (more on that later).  If you want to give users the option of getting the latest data without waiting for the periodic update (or changing the read only status of the master file!), you can use the following block instead.  It will ask the user upon opening the document whether or not they want to go retrieve the latest data:

CODE

    If ActiveWorkbook.ReadOnly Then
        Dim sMsg As String
        sMsg = "Sheet last updated " & ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
        sMsg = sMsg & vbCrLf & vbCrLf & "File is currently open as read-only."
        sMsg = sMsg & vbCrLf & "Accept the currently saved values?" & vbCrLf
        sMsg = sMsg & "Choosing ""No"" will increase time required to open."
        If MsgBox(sMsg, vbYesNo) = vbYes Then
            Exit Sub
        End If
    End If

Now, take the following block of code and paste it into a new text file in Notepad and save it as a ".vbs" (for VBScript) file.  

CODE

const WBPATH = "ENTER THE PATH TO YOUR EXCEL FILE HERE"

dim xlApp        'Excel Application Object
dim xlWorkbook    'Excel Workbook object
dim sWkBkPath    'String
dim fso        'File System Object
dim wbFile        'File object

set fso = createobject("Scripting.FileSystemObject")
set wbFile = fso.getfile(WBPATH)

if wbfile.attributes AND 1  then
    wbfile.attributes = wbfile.attributes - 1
end if


set xlApp = CreateObject("Excel.Application")

set xlWorkbook = xlApp.Workbooks.Open(WBPATH)

xlApp.Visible = FALSE  'Make true if you want to see the workbook

xlWorkbook.Save

xlWorkbook.Close
xlApp.Quit

set wbFile = fso.getfile(WBPATH)

if not (wbfile.attributes AND 1) then
    wbfile.attributes = wbfile.attributes + 1
end if

set xlWorkbook = Nothing
set xlApp = Nothing
set wbFile = Nothing
set fso = Nothing

This little script will set the master file to be non-read-only, open the file (which runs the update macro), save the file, close the file, and set it back to read only.  Of course, you'll have to put the path to your Excel file in that WBPATH constant at the very top.

Once you've done that, you can use Windows Task Scheduler to run the script on whatever schedule you want. Just go to Control Panel, choose Scheduled Tasks, and use the "Add Scheduled Task" icon to schedule it.  Note that the wizard that starts automatically is really pretty limited.  However, if you check the box for "Open Advanced Properties" on the last page of the wizard you can set up whatever kind of schedule you want.  Once a day, twice a day, once an hour, every minute, whatever you like.  

Hope this helps!

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman I have to say that this is super sweet. My only slight problem now is that if I select "no" when I open the spreadsheet and update it, when I go to close it, excel gives me a pop-up window asking if I would like to save my changes. If I select no, it closes and everything is fine. If I select yes, it opens the save as window since the copy I have open is read only. Is there any way to force excel to not ask if I would like to save the sheet if I update the read only version? I have it set to update automatically through your script every 10 minutes, so I don't need to worry about saving the read only updated sheet. I really see this as my last obstacle for this thing. Thank you so much for all of your help. There is definitely no way I would have been able to do this without you and the other on this forum. Once I have it done, I am thinking about zipping it all up and posting it here.

RE: SW Custom Property Linking in Excel's VB

You can suppress that dialog by adding the subroutine:

CODE

Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub

You're basically lying to Excel, telling it that you've not really made any changes since the last save.  You can tell Excel this "ActiveWorkbook.Saved = True" lie anywhere in code you want.  Excel will believe you until you make another change to the workbook.  

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman, I have a new problem! We recently got a external drive system that we have added to our network as a shared drive. I moved all of our drawing files to this drive, including the folder containing all of this excel workbook. Now when I try to run the program, I get the following error:

run-time error - 2147287039 (80030001)
Method 'open' of object '_oledocumentproperties' failed

I am thinking that some kinda of reference is missing suddenly, or something strange. Let me know if you have any ideas. Thanks.

RE: SW Custom Property Linking in Excel's VB

A lot can change in six months... could you post a current copy of your code, and specify which line is causing the error?  If you wish, you could just upload a copy of the spreadsheet via the new file attachment capability.

RE: SW Custom Property Linking in Excel's VB

(OP)
Sub workbook_open()

If ActiveWorkbook.ReadOnly Then
        Dim sMsg As String
        sMsg = "*********************************"
        sMsg = sMsg & vbCrLf & "TMC DRAWING DATABASE NOTIFICATION" & vbCrLf
        sMsg = sMsg & vbCrLf & "*********************************" & vbCrLf
        sMsg = sMsg & vbCrLf & "THIS SHEET WAS LAST UPDATED: " & ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") & vbCrLf
        sMsg = sMsg & vbCrLf & vbCrLf & "Select ""YES"" to continue with current data"
        sMsg = sMsg & vbCrLf & "Select ""NO"" to update the data" & vbCrLf
        sMsg = sMsg & vbCrLf & "***************************************************************" & vbCrLf
        sMsg = sMsg & "HINT: CHOOSING ""No"" WILL INCREASE THE TIME TO OPEN THIS SHEET"
        If MsgBox(sMsg, vbYesNo) = vbYes Then
            Exit Sub
        End If
    End If
Dim i As Long, z As Long, Rw As Long
    Dim ws As Worksheet
    Dim y As Variant
    Dim fLdr As String
    Dim fil As String
    Dim DSO As DSOFile.OleDocumentProperties
    Dim FPath As String
   
    Dim Object As String
    Set OBJFILE = CreateObject("DSOFile.OleDocumentProperties")
    y = "*.*"
    If y = False And Not TypeName(y) = "STRING" Then Exit Sub
    Application.ScreenUpdating = False

           '**********************************************************************
     'fLdr = BrowseForFolderShell
    fLdr = "x:\"
    
     '**********************************************************************
  
    With Application.FileSearch
        .NewSearch
        .LookIn = fLdr
        .SearchSubFolders = False
        .Filename = y
        
       
        Set ws = ThisWorkbook.Worksheets.Add(Sheets(1))
        On Error GoTo 1
2:      ws.Name = "TMC DRAWING LIST"
            On Error GoTo 0
            If .Execute() > 0 Then
            For i = 1 To .FoundFiles.Count
                fil = .FoundFiles(i)
                Set DSO = New DSOFile.OleDocumentProperties
crashes here---->   DSO.Open SFileName:=fil, ReadOnly:=True, Options:=dsoOptionOpenReadOnlyIfNoWriteAccess
                
                            
                   'Get file path from file name
                   
                                 
                   
                
                FPath = Left(fil, Len(fil) - Len(Split(fil, "\")(UBound(Split(fil, "\")))) - 1)
                If Left$(fil, 1) = Left$(fLdr, 1) Then
                    If CBool(Len(Dir(fil))) Then
                        z = z + 1
                        ws.Cells(z + 1, 1).Resize(, 8) = _
                        Array(Dir(fil), _
                        DSO.SummaryProperties.DateLastSaved, _
                        IsProp(DSO.CustomProperties, "Description"), _
                        IsProp(DSO.CustomProperties, "material"), _
                        IsProp(DSO.CustomProperties, "Customer"), _
                        IsProp(DSO.CustomProperties, "Project"), _
                        IsProp(DSO.CustomProperties, "UserDefined1"), _
                        IsProp(DSO.CustomProperties, "UserDefined2"), _
                        IsProp(DSO.CustomProperties, "LINE_NO"), _
                        IsProp(DSO.CustomProperties, "LINE_DESC"), _
                        IsProp(DSO.CustomProperties, "PRODUCT_DESC"), _
                        IsProp(DSO.CustomProperties, "PRODUCT_CONF"))
                        


                                                                      
                        ws.Hyperlinks.Add Anchor:=Cells(z + 1, 1), _
                        Address:=.FoundFiles(i)
                    End If
                End If
            Next i
        End If
    End With
     
    ActiveWindow.DisplayHeadings = False
     
    With ws
        Rw = .Cells.Rows.Count
        With .[a1:L1]
            .Value = [{"FILE NAME (CLICK TO OPEN)","LAST MODIFIED"," FILE DESCRIPTION","MATERIAL","CUSTOMER","WORKORDER NO.","COMPUTER ID NO.","CUSTOMER DWG NO.","LINE NO.","LINE DESCRIPTION","PRODUCT DESCRIPTION","PRODUCT CONFIGURATION"}]
            .Font.ColorIndex = vbBlack
            .Font.Bold = True
            .Font.Size = 11
            .Cells.Interior.Color = vbGreen
            Range("A1").AutoFilter field:=1, Criteria1:="*", VisibleDropDown:=True
            .EntireColumn.AutoFit
            .HorizontalAlignment = xlLeft
            

             
        End With
        .[M1:IV1 ].EntireColumn.Hidden = True
        
        On Error Resume Next
        Range(Cells(Rw, "A").End(3)(2), Cells(Rw, "A")).EntireRow.Hidden = True
        Range(.[A2 ], Cells(Rw, "C")).Sort [A2 ], xlAscending, Header:=xlNo
        
        End With
        
    Application.ScreenUpdating = True
    Exit Sub
1:          Application.DisplayAlerts = False
    Worksheets("TMC DRAWING LIST").Delete
    Application.DisplayAlerts = True
    GoTo 2
    
  
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Saved = True
End Sub




Function IsProp(myCProps As Object, myMemName As String) As String
    Dim testProp As Object
    On Error Resume Next
    Set testProp = myCProps(myMemName)
    If testProp Is Nothing Then
        IsProp = "N/A"
    Else
        IsProp = testProp.Value
    End If
    On Error GoTo 0
End Function
   


   
   

RE: SW Custom Property Linking in Excel's VB

(OP)
The program crashes on DSO.Open SFileName:=fil, ReadOnly:=True, Options:=dsoOptionOpenReadOnlyIfNoWriteAccess

I thought it may be a missing reference, but its not as far as I know. The strange thing is that it can make it through Solidworks files in the that folder no problem, its other files such as step files or autocad files that it chokes on. Maybe I missing a reference for those? I don't see why it would change though. Oh and just so you know, all that I have done is moved the folder which contained this spreadsheet as well as all of the drawings to a new shared drive on an external hard drive. I am wondering if it is possible if that new drive isn't allowing this function or something along those lines?? My error is;

Run-time error -2147287039 (800300001)
Method 'Open' of object '_OleDocumentProperties' failed

RE: SW Custom Property Linking in Excel's VB

This is pretty strange.  I'm not able to reproduce the error on my end.  You say that SolidWorks files work fine.  Just for fun, can you try changing the line:

y = "*.*"

to

y = "*.sld*"

and see if the program will run all the way through for you?  If so, and if you only want to list SW files, then I guess you're set.  Otherwise, we'll have to dig a bit more.

Do you have any details about your "external drive system"?  Encryption?  Compression?  Firewall?

RE: SW Custom Property Linking in Excel's VB

(OP)
haha, this is strange. I changed to y = "*.sldprt" and the program ran through without an error, however it didn't actually list and of the solidworks files in the spreadsheet. It just created the spreadsheet with all of the headings but nothing listed beneath. I am starting to think more and more that this is a external drive problem. I will try some things on the drive and repost in a while. By the way, I still want to be able to list all file types in that folder, or atleast all solidworks files (.sldprt,.sldasm,.slddrw), all autocad formats (.dxf,.dwg) and PDF files if possible. Is it likely that a firewall or security setting on the new drive may be the problem?

RE: SW Custom Property Linking in Excel's VB

That's why I suggested changing to

y = "*.sld*"

instead of

y = "*.sldprt"

*.sld* should get you all SolidWorks files, and should also help if you're somehow getting into DOS style 8.2 file naming issues.

RE: SW Custom Property Linking in Excel's VB

Sorry, I meant 8.3.

RE: SW Custom Property Linking in Excel's VB

(OP)
Tried it, still didn't work. Changed the security settings on the NAS to allow everyone full control and it didn't help. I am confused.....I read before it is working fine on your end?

RE: SW Custom Property Linking in Excel's VB

Yes, working fine.  I have no problems at all on my end.  What were the results with y = "*.sld*"?  Same as "*.sldprt" (program runs, but no files found)?

RE: SW Custom Property Linking in Excel's VB

(OP)
yes it was the same.

RE: SW Custom Property Linking in Excel's VB

OK, what about if you use "*.s*"? still no files found?

RE: SW Custom Property Linking in Excel's VB

(OP)
same thing......shows up, but nothing listed

RE: SW Custom Property Linking in Excel's VB

(OP)
Okay well I am lost at this point. I tried copying the file and some folders back ot the original location, and it runs but doesn't list the files in the folder anymore. Something has had to of changed somewhere. It still won't run through on my new shared drive, gives the runtime error every time. Should I try re-installing the DSO file??

RE: SW Custom Property Linking in Excel's VB

Sorry, Puds.  I'm just not able to reproduce your problem, so it's very difficult to try to debug from here.  You could try reinstalling DSO, but I'm not sure that would help, especially if you don't seem to be finding any files.  I'm able to access both network and local directories with no problems.  

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman, I appreciate all of your help, I would have never had this thing working without you in the first place. Do you think however, that this could be a network problem with security/permissions? I did try to have it look in my c: instead of a network drive, and it still didn't find any files, but it didn't crash. I will try copying the actual file to my c: and then running it.

RE: SW Custom Property Linking in Excel's VB

(OP)
Tried c:\, still doesn't list any files. Can you maybe post your copy and I will copy and paste into my file. Maybe something small got changed by accident and I am just missing it.

RE: SW Custom Property Linking in Excel's VB

It's really hard to say.  If I were able to reproduce the problem, the next thing I would do is start at the beginning of the code and verify that every line was actually doing what it is supposed to do.  Very frequently when you get an error message, the problem is that some other line of code is not doing what you expected it to.  

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman, what references are you using with this app? Also, I can get it to run on my new shared drive finally, but it doesn't list any files, but it goes thorugh it without an error. Is there any way I can add an error checking code to it to see what is causing the problem?

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman, I basically rewrote the entire program, line by line to see if it was just a corrupt file. I have finally got the program working (must have been corrupt), but I still get errors only when it searches through specific file types such as .dwg (autocad) or .vnc (gibbscam). I am kind of making an assumption that this is because there is no references for those object types loaded? Is this a good thought? If so, I don't know if I can find the dll files for those programs, so is there anyway that I can just search only for solidworks files (*.sld) doesn't seems to work but I can return all of the file types (.sldprt, .slddrw, .sldasm if I set y equal to those types individually. Its really strange how this has all changed. I had no problems with any file types previously. Any thoughts?

RE: SW Custom Property Linking in Excel's VB

Sorry, puds, but I'm really at a loss.  I downloaded the file you posted, changed the search path to a folder with various types of files, and ran the code.  All files, regardless of type, were listed in the spreadsheet.  The other file types (dxf, txt, etc) were shown, just without any custom properties.  Pretty much all you can do at this point is to test each line of the code to make sure it's doing what you expect.  For example, near the beginning of your code you have the line:

Set OBJFILE = CreateObject("DSOFile.OleDocumentProperties")

To verify that it is at least doing something, you can follow that line with

Debug.Print OBJFILE Is Nothing

If your immediate window shows "True" then you know that the Set statement failed somehow.  Next you have the line:

y="*.*"

you can verify that this statement worked correctly by the line

Debug.Print y

You should see *.* in the immediate window.  You can do this sort of thing for every line until you find the line that is not behaving in the way you expect.

I used to use MsgBox a lot for this type of debugging. However, if you put a MsgBox inside a looping section of the code you'll have to do a lot of clicking while it goes through the loop.  Debug.Print just outputs to the immediate window.

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman, I just want to check to see what references you have set in your file. Can you list them. This is my last option at this point. The fact that mine will run for any solidworks files (and I have the Sw_objects.dll reference loaded) makes me wonder if I am missing some windows dll that should be referenced or if I should maybe reload those dll or tlb files because they have been corrupted. This is more than a bit of a headache, but I need to get this sorted out. At this point it crashes on any other file extension besides solidworks files. Maybe that sparks an idea for you?

RE: SW Custom Property Linking in Excel's VB

(OP)
Found something that may be causing my problem?? Interop.DSOfile.dll is not registered or referenced. I tried ot reference in my application, but it gives an error cannot be referenced. When I try to register it using regsvr32 "c:\dsofile\INTEROP.DSOFILE.dll", I get this error:

"c:\dsofile\INTEROP.DSOFILE.dll" was loaded, but the dll registry point was not found. This file can not be registered.

RE: SW Custom Property Linking in Excel's VB

(OP)
Handleman,

Just another update, finally got it fixed enough to be able to use it again. I changed y="*.*" to y="*.sld*" and now it will display all solidworks types only. That is good enough for what we use it for, for now anyways. Thanks for all of your help. Maybe one day I will figure out why it stopped being able to run all file extensions. It is quite strange.

RE: SW Custom Property Linking in Excel's VB

puds,
What happens if you use just y="*"

cheers

RE: SW Custom Property Linking in Excel's VB

(OP)
then it won't display anything at all. y="*.*" does work, however when the program finds a file type that is anything other than a solidworks file, it gives the error method open of object 'oledoecumentproperties' failed. I actually just tried out the dsofile demo that comes in the download package from microsoft, and even that doesn't work for any other file types besides solidworks. However the demo program did give me some more info on the error - it seems the problem is with the interop.dsofile.dll, which by the way I cannot get to register. here is the error from the demo:

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80030001): Unable to perform requested operation.
   at DSOFile.OleDocumentPropertiesClass.Open(String sFileName, Boolean ReadOnly, dsoFileOpenOptions Options)
   at FilePropDemoVB7.FilePropDemo.OpenDocumentProperties() in D:\CDBackup\Projects\dsofile\2.1\Samples\VB7\FilePropDemo.vb:line 524
   at FilePropDemoVB7.FilePropDemo.cmdOpen_Click(Object sender, EventArgs e) in D:\CDBackup\Projects\dsofile\2.1\Samples\VB7\FilePropDemo.vb:line 724
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2407
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
FilePropDemoVB7
    Assembly Version: 1.0.1.0
    Win32 Version: 1.0.1.0
    CodeBase: file:///C:/DsoFile/Demo/FilePropDemoVB7.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2407
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.2032
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
Interop.DSOFile
    Assembly Version: 2.1.0.0
    Win32 Version: 2.1.0.0
    CodeBase: file:///C:/DsoFile/Demo/Interop.DSOFile.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 7.0.5000.0
    Win32 Version: 7.10.6001.4
    CodeBase: file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
CustomMarshalers
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/custommarshalers/1.0.5000.0__b03f5f7f11d50a3a/custommarshalers.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.


RE: SW Custom Property Linking in Excel's VB

As I said, I downloaded your file and used it directly.  The list of referenced DLLs is saved in the file.  The only ones referenced in my copy are (in order, top to bottom):

Visual Basic for Applications
Microsoft Excel 11.0 Object Library
OLE Automation
Microsoft Office 11.0 Object Library
DSO OLE Document Properties Reader 2.1

Interop.DSOFile.DLL is not used by anything except the demo program.  I can rename that file and the code still runs.  Have you tried this on other computers?  Have you verified that your DSOFile.DLL is not corrupt?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources