how to make an object point to a file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mariyana
    New Member
    • Mar 2007
    • 11

    how to make an object point to a file

    I have file in a path.

    Eg: filename is donno.xml in "c:\temp" .

    I have an object call objRep. How can make this object point to filename( donno.xml)
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by mariyana
    I have file in a path.

    Eg: filename is donno.xml in "c:\temp" .

    I have an object call objRep. How can make this object point to filename( donno.xml)
    Hm... does that mean you want it to be an Excel workbook? Or a file object? You might want to check out FileSystemObjec t.

    Comment

    • mariyana
      New Member
      • Mar 2007
      • 11

      #3
      actually i have used the code

      <//////code//////>
      dim objRep as DOMDocument30
      dim path as string

      path= :c:\temp\report s.xml"
      objRep.Load path

      </////////////code////////>
      but then its throwing an error "object variable or with block variable not set"......

      What i need to do exactly is get the node called sort from the xml file and print the value in the excel

      Originally posted by Killer42
      Hm... does that mean you want it to be an Excel workbook? Or a file object? You might want to check out FileSystemObjec t.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Not sure about this, but you might try...

        dim objRep as New DOMDocument30

        and see what happens.

        Also, here's a link to another thread which looks as though it might provide some useful code examples.

        Comment

        Working...