+ Reply to Thread
Results 1 to 9 of 9

Script fails to run in other office/vba version 2007 > 2003

  1. #1
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Script fails to run in other office/vba version 2007 > 2003

    Hello i have some code and i get some odd error when trying to run my code on a 2003 excel/VBA vers.

    It gives an error at the Format function. which worked fine in 2007.
    altough the other computer had excel 2007, the file is build up from a .xls (2003).



    the code it selects when trying to run:

    Please Login or Register  to view this content.
    The fat text is selected with an error wich says something like: "The project cannot be found".

    Any ideas how to fix this problem?

    My own guess is that it doesnt see "Format" as a excisting function. in other words its an undeclared variable. wich is not the case with the previous in the excel 2007 software on the different computer.

    excel type = .xls (2003 main)
    Last edited by vin1; 02-21-2012 at 06:48 AM.

  2. #2
    Forum Contributor
    Join Date
    02-08-2012
    Location
    South Suffolk
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Script fails to run in other office/vba version 2007 > 2003

    FORMAT$() certainly works in code written in Excel 2007 (Win7) and run on Excel 2003 (XP). I can't comment on FORMAT() running or not but I think it is in the Excel 2003 function list.

  3. #3
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: Script fails to run in other office/vba version 2007 > 2003

    i whould think so too but for reason it doesnt see as if it is so.

    is there any other way or other function how i can format some value in a textbox?


    I can say that the current computer i am working on is very old (i think Windows XP).
    but in the end i want this program be able to run on any microsoft / vba version if possible.

  4. #4
    Forum Contributor
    Join Date
    02-08-2012
    Location
    South Suffolk
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Script fails to run in other office/vba version 2007 > 2003

    Could this be amissing reference (see http://www.cpearson.com/excel/missingreferences.aspx) and check in VBA Tools/references for which MS Office library is installed.
    Last edited by AndyPS; 02-21-2012 at 07:07 AM. Reason: Corrected link

  5. #5
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: Script fails to run in other office/vba version 2007 > 2003

    In that screen 4 lines are turned on:

    Visual basic for applciations, Microsoft excel 11.0 Object Library, OLE Auotmation, Microsoft office 11.0 Object Library.
    As far i can see notting else is turned on and notting is missing.

    Wich line should be turned on for the function to make work?

    I have no clue what each line is used for

  6. #6
    Forum Contributor
    Join Date
    02-08-2012
    Location
    South Suffolk
    MS-Off Ver
    Excel 2007
    Posts
    102

    Re: Script fails to run in other office/vba version 2007 > 2003

    I think it is the Visual Basic for Applications reference. Have you tried prefacing the function with VBA. (i.e.VBA.FORMAT()) to see if the explicit declaration works.
    Also, do any other functions throw errors?
    I have experienced intermittent problems with code use in a corporate environment with different builds of XP Professional and MS Office (11) though this was with scripting objects and caused problems at run time despite compiling OK. I believe this is late binding.

  7. #7
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Script fails to run in other office/vba version 2007 > 2003

    Are you checking the reference on the machine with the problem? I would put money on it being a missing reference, since Format is a native VBA function.
    Last edited by OnErrorGoto0; 02-21-2012 at 01:02 PM. Reason: typo
    Good luck.

  8. #8
    Forum Contributor
    Join Date
    02-07-2011
    Location
    netherlands
    MS-Off Ver
    Excel 2003
    Posts
    128

    Re: Script fails to run in other office/vba version 2007 > 2003

    Yesterday there were not any refererences missing (perhaps somethign was not turned on)

    today when i try open my programcode it gives an error: "cannot load DLL"
    When i check my referances the next line is missing: "MISSING: Ref Edit Control"
    This line was not turned on yesterday.

    i did not make any changes since yesterday.

    It is a bit weird for me and because of this, I cannot work on my project on this computer at the moment.

    #Edit I can acces 1 userform actualy but the rest are most returning into an error.
    Last edited by vin1; 02-22-2012 at 04:39 AM.

  9. #9
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Script fails to run in other office/vba version 2007 > 2003

    Try unchecking the reference. You should not actually require a reference to use a RefEdit control. (they are however troublesome creatures. You may want to use Application.Inputbox instead))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1