PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
[RESOLVED] data type/variable no longer recognised-VBForums
Results 1 to 10 of 10

Thread: [RESOLVED] data type/variable no longer recognised

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Resolved [RESOLVED] data type/variable no longer recognised

    I'm trying to run a Word VBA macro and am getting an error message I never had before. My normal.dot template got corrupted last week and I had to remake it, so it's probably linked to that.

    Anyway, this line is no longer understood by the compiler:

    Dim MyDataObj As New DataObject

    "User defined type not defined" is the message.

    Any ideas what I need to add so that this type is recognised again?

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

    Re: data type/variable no longer recognised

    The type or class DataObject should be declared somewhere.

  3. #3
    Addicted Member
    Join Date
    Jan 2004
    Location
    philippines
    Posts
    245

    Re: data type/variable no longer recognised

    check for references Project > References try to check if there are any missing objects.. just un check it.. apply.. and add the object again.

  4. #4
    Lurker
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,651

    Re: data type/variable no longer recognised

    Aside from that, please, for heaven's sake:

    VB Code:
    1. Dim MyDataObj As DataObject
    2. Set MyDataObj = New DataObject

    There, that makes me feel better

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: data type/variable no longer recognised

    I'm sorry, I posted this in the wrong forum, it should have been in the VBA section.

    Quote Originally Posted by penagate
    Aside from that, please, for heaven's sake:

    visual basic codeim MyDataObj As DataObject
    Set MyDataObj = New DataObject



    There, that makes me feel better
    I promise to do it in future if you tell me what the difference is

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: data type/variable no longer recognised

    Thanks for all your replies, btw. The necessary add-in was here:
    Attached Images Attached Images  

  7. #7
    Lurker
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,651

    Re: data type/variable no longer recognised

    I explain it all here

  8. #8
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: data type/variable no longer recognised

    Quote Originally Posted by pickarooney
    I'm sorry, I posted this in the wrong forum, it should have been in the VBA section.


    I promise to do it in future if you tell me what the difference is
    Objects declared with New are instantiated on their first use... so compiler has to keep track everytime they are used whether the object is already instantiated or not... this puts an additional overhead.. .it makes it slow and therefore discouraged

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: [RESOLVED] data type/variable no longer recognised

    OK, that makes sense. Sorry I couldn't give rep points to everyone as I needed to spread it around a bit before I could give it again (not quite sure what that's about).

  10. #10
    Lurker
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,651

    Re: [RESOLVED] data type/variable no longer recognised

    I explain that also in my (and Robdog's) "Reputations and rating posts" FAQ, link in my sig

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width