Results 1 to 7 of 7

Thread: [RESOLVED] Invalid use of property?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Resolved [RESOLVED] Invalid use of property?

    VB Code:
    1. FileCopy "c:\vbfiles\a.txt", "c:\vbfiles\china\a.txt"

    Comment?

    In a new form that code will work (eh, it would if that file was ther ), but in my current form i get that error that ("Invalid use of property").
    Last edited by Zeratulsdomain; Oct 27th, 2005 at 08:01 PM.

  2. #2
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: Invalid use of property?

    What is the difference between the 'new' form and the 'current' form?
    What makes these forms 'new' and 'current'?

    Is there any other code?

  3. #3
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: Invalid use of property?

    I tried this on my visual basic and it worked:

    VB Code:
    1. Private Sub Command1_Click()
    2.    FileCopy "C:\Documents and Settings\Owner\Desktop\test.doc", "C:\Documents and Settings\Owner\Desktop\test2.doc"
    3. End Sub

  4. #4
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Invalid use of property?

    then try it again paralinx, you need to kill the second path first, i think.

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Invalid use of property?

    Nope. This worked fine.

    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.   Open "G:\text.txt" For Output As #1
    5.     Write #1, "this is a test"
    6.   Close #1
    7.   FileCopy "g:\text.txt", "g:\text1.txt"
    8.   FileCopy "g:\text.txt", "g:\text1.txt"
    9. End Sub

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Invalid use of property?

    If I were a betting gnome, I'd bet that there is a PROPERTY in the class where he's trying to use the code called FileCopy..... and since it isn't qualified, it's using the closest one to it, which would be the property and not the function. But I'd only bet that if I were a betting gnome.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    431

    Re: Invalid use of property?

    oops, sry my bad...

    I had named my sub FileCopy (which just happend to be the very line of code vb uses )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width