Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2017, 08:45 AM
silentwolf silentwolf is offline Runtime Error 91 Windows 7 64bit Runtime Error 91 Office 2010 64bit
Novice
Runtime Error 91
 
Join Date: Dec 2016
Location: Austria
Posts: 16
silentwolf is on a distinguished road
Default Runtime Error 91

Hi guys,



I am not that good in word VBA and need some advice to this problem...

Below is the code but I do get a runtime error 91 in the line marked below.
Object Variable or with block not declared..

Could someone tell me what is causing this problem?


Code:
Property Get Textmarke(strName As String) As String
    DieseDateiBenutzen
    If p_docDO.Bookmarks.Exists(strName) Then
        Textmarke = p_docDO.Bookmarks(strName).Range.Text
    Else
        Textmarke = ""
    End If
End Property

Property Let Textmarke(strName As String, strText As String)
    Dim rngTM As Range

    If p_docDO.Bookmarks.Exists(strName) Then
    Set rngTM = p_docDO.Bookmarks(strName).Range

        rngTM.Text = strText
        rngTM.Bookmarks.Add strName
    Else
        MsgBox "Diese Textmarke fehlt: " & strName, vbCritical
    End If
End Property
Read on the help file but can not realy understand what I need to change.

Many thanks for your help..

Silentwolf
Reply With Quote
  #2  
Old 07-22-2017, 10:15 AM
gmaxey gmaxey is offline Runtime Error 91 Windows 7 32bit Runtime Error 91 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Is p_docDo declared as a document object and set to some opened document?

What Textmarke a property of?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 07-23-2017, 12:04 AM
silentwolf silentwolf is offline Runtime Error 91 Windows 7 64bit Runtime Error 91 Office 2010 64bit
Novice
Runtime Error 91
 
Join Date: Dec 2016
Location: Austria
Posts: 16
silentwolf is on a distinguished road
Default

Hi,
thanks for your reply!

I found the problem )
I did not set the sub in the Property Let procedure!

DieseDateiBenutzen was missing in the property let statement!

Thanks for pointing it out to me!


Silentwolf
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel runtime error 48; error in loading dll mwittman5 Excel Programming 0 01-19-2017 05:18 PM
Runtime Error 91 Runtime error R6034 tallon Excel 4 07-08-2016 09:24 AM
Runtime Error 91 runtime error 1004 gbaker Excel Programming 11 06-06-2012 05:23 AM
Runtime Error 91 Runtime error 91 waldux Word VBA 1 03-04-2011 11:25 PM
Runtime error 5487 - Word cannot complete the save to to file permission error franferns Word 0 11-25-2009 05:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft