X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Programmatic Access to Excel (Office) XP/2003 VBA Projects    
post Oct 3 2005, 09:09 AM

Retired Moderator
Posts: 10,959
Joined: 9-October 03
From: Prague,CZ / Kiev,UA

aving been freshly migrated to Office 2003, today I wondered why this trivial code:
Sub GetListOfRefs()
    Dim rf As Reference
    For Each rf In ThisWorkbook.VBProject.References
        Debug.Print rf.Name
End Sub

wouldn't work. It returned a "Programmatic Access to VBA Project denied" error. The message appeared only once, then just the confusing message
"VBProject method failed"
appears over and over.
HAs everybody knows, MS has somewhat enhanced the Office security model since XP. I have found the solution to the above mentioned problem here:
Oknow that it's pretty obvious for all XP freaks around here, but it took me some 15 minutes of my life to find out so I thought it could be good contribution to FAQs...
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    16th October 2019 - 01:59 AM