Hi,
Anyone know how MS XP changes references from Excel to Word?
John
Hi,
Anyone know how MS XP changes references from Excel to Word?
John
Hi John
which references are you referring to? do you mean the Object library references or do you mean Application.Version?
Graeme
The former. They are still checked in the references tick box list, they are just showing errors when I try to run the app which uses the following code:-
Set wordApp = GetObject(, "Word.Application")
I think MS have changed the way that vba can reference other applications in a woefully inadequate (Oh, look, there goes the horse, anyone check the stable door recently?) attempt to provide security from email virii
John
Hi John,
I have seen this problem before what you need to do is to go into Word and Excel and on the Tools|Macros|Security menu select the Trusted sources tab and check the Trust access to Visual Basic Project.
You should also set the Security Setting to Low (this is OK so long as you have Anti Virus software installed).
This should do the trick.
Graeme
hi John,
have a look at the knowledgebase thread for some more info.
http://support.microsoft.com/default.aspx?s…&Product=xl2002
Graeme
Hi John,
I have been looking for a way to change the settings using code. I haven't found any but I did find a bit of code on John Walkenbach's site which will prompt a user to adjust their settings.
HTH
Graeme
[code]
' Make sure access to the VBProject is allowed
Dim VBP As Object ' as VBProject
If Val(Application.Version) >= 10 Then
On Error Resume Next
Set VBP = ActiveWorkbook.VBProject
If Err.Number <> 0 Then
MsgBox "Your security settings do not allow this procedure to run." _
& vbCrLf & vbCrLf & "To change your security setting:" _
& vbCrLf & vbCrLf & " 1. Select Tools - Macro - Security." & vbCrLf _
& " 2. Click the 'Trusted Sources' tab" & vbCrLf _
& " 3. Place a checkmark next to 'Trust access to Visual Basic Project.'", _
vbCritical
Exit Sub
End If
End If
[\code]
Don’t have an account yet? Register yourself now and be a part of our community!