Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Module works in Windows 2000 but not XP (Excel 2003)

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    Hi, I hope someone out there can help me. The code attached originally comes from John Walkenbach's site - (http://j-walk.com/ss/excel/tips/tip76.htm). I have emailed him my problem but as I have not heard from him yet wonder whether anyone else can assist. The code is to create a userform on the fly and works fine under Windows 2000 but not under Windows XP - no userforms are created.

    The first problem is with :

    ' Hide VBE window to prevent screen flashing
    Application.VBE.MainWindow.Visible = False

    where the user gets the message

    Run-time error '1004': Programmatic access to Visual Basic Project is not trusted

    If he comments this out, he next hits a snag with:

    ' Create the UserForm

    Set TempForm = ThisWorkbook.VBProject.VBComponents.Add(3)
    TempForm.Properties("Width") = 800
    where he gets the same message.

    I am unable to attach the excel file as zipped (even with all data that I can stripped out) is 473kb.



    Any assistance would be appreciated.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Module works in Windows 2000 but not XP (Excel 2003)

    Everyone who uses this code must do the following in Excel:
    - Select Tools | Macro | Security...
    - Activate the Trusted Sources tab.
    - Tick the check box "Trust acces to Visual Basic Project"
    - Click OK.

  3. #3
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Module works in Windows 2000 but not XP (Excel 2003)

    Thanks very much Hans for your prompt reply. Problem solved!

    Raymond

  4. #4
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi All, sorry to raise this one again, but is it possible via VBA to check to see if the user has this setting ticked, and if not tick it?

    Thanks

    Raymond

  5. #5
    Star Lounger
    Join Date
    Jun 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    59
    Thanks
    2
    Thanked 0 Times in 0 Posts
    OK guys found Topic 506360

Posting Permissions

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