Macro Run Time Error 5941
Contents |
360 games PC games run time error 4605 this command is not available Windows games Windows phone games Entertainment All Entertainment
Run-time Error '5941' Application-defined Or Object-defined Error
Movies & TV Music Business & Education Business Students & educators run time error 5941 word 2013 Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet run time error 4605 word 2010 Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All
Runtime Error 4248 This Command Is Not Available Because No Document Is Open
Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
here for a quick overview of the runtime error 4248 word 2010 site Help Center Detailed answers to any questions you runtime error 4248 word 2013 might have Meta Discuss the workings and policies of this site About Us Learn
The Requested Member Of The Collection Does Not Exist Word 2013
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags https://support.microsoft.com/en-us/kb/813983 Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Runtime Error '5941' The Requested Member of Collection Does Not http://stackoverflow.com/questions/30705042/runtime-error-5941-the-requested-member-of-collection-does-not-exist Exist up vote -1 down vote favorite When running the macro I am getting the following error: "Runtime Error '5941' The Requested Member of Collection Does Not Exist" The line below is highlighted in Yellow; This Macro works on the majority of users and the error has only been reported off two users. Windows(DestTemplateName).Document.Bookmarks("fCustomer").Range.Fields(1).Result.Text = Windows(SourceTemplateName).Document.Bookmarks("fCust").Range.Fields(1).Result.Text Any Help Would Be Much Appreciated. Sub PopulateBookingForm() Dim SourceTemplateName As String, DestTemplateName As String ' Set Method Statement Name SourceTemplateName = ActiveDocument.Name ' Open Heavy Cranes ICO Booking Form ChangeFileOpenDirectory "\\SERVERSHARE\HCD\HCD General\Templates\" Documents.Open FileName:= _ "\\SERVERSHARE\HCD\HCD General\Templates\Heavy Cranes ICO Booking Form.docx", _ ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _ PasswordDocument:="", PasswordTemplate:="", Revert:=False, _ WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _ wdOpenFormatAuto, XMLTransform:="" Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting ' Set Haulage Booking Form Document Name DestTemplateName = ActiveDocument.Name ' ### START FIND AND REPLACE ' Populate Customer(Client) Windows(DestTemplateName).Document.Bookmarks("fCustomer").R
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business http://stackoverflow.com/questions/34617417/5941-error-the-requested-member-of-the-collection-does-not-exist-word-macro Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation http://visualbasic.ittoolbox.com/groups/technical-functional/vb-vba-l/runtime-error-5941-the-requested-member-of-the-collection-does-not-exist-5380945 Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 5941 Error The requested member of the collection does not exist Word Macro up vote 0 down vote favorite Good Day all. I'm time error far from a programmer however i need assistance finding out the error with this VBA script. It is run in a word document for repair order form. Its purpose is to increase the order number by one for each print. The counter updates a .txt file To identify the next number needed to print. That as far as my understanding goes. The code is below. Sub serialNumberPrint() ' ' SerialNumber Macro ' ' Dim Message run time error As String, Title As String, Default As String, NumCopies As Long Dim Rng1 As Range ' Set prompt. Message = "Enter the number of copies that you want to print" ' Set title. Title = "Print" ' Set default. Default = "1" ' Display message, title, and default value. NumCopies = Val(InputBox(Message, Title, Default)) SerialNumber = System.PrivateProfileString("C:\Users\GaleR\Documents\SettingsSerial.Txt", _ "MacroSettings", "SerialNumber") If SerialNumber = "" Then SerialNumber = 1 End If Set Rng1 = ActiveDocument.Bookmarks("SerialNumber").Range Counter = 0 While Counter < NumCopies Rng1.Delete Rng1.Text = Format(SerialNumber, "000#") ActiveDocument.PrintOut SerialNumber = SerialNumber + 1 Counter = Counter + 1 Wend 'Save the next number back to the Settings.txt file ready for the next use. System.PrivateProfileString("C:\Users\GaleR\Documents\SettingsSerial.txt", "MacroSettings", _ "SerialNumber") = SerialNumber 'Recreate the bookmark ready for the next use. With ActiveDocument.Bookmarks .Add Name:="SerialNumber", Range:=Rng1 End With ActiveDocument.Save End Sub The debug brings me to this line: Set Rng1 = ActiveDocument.Bookmarks("SerialNumber").Range I am at wits end and am not sure how to proceed. I apologize beforehand for my lack of knowledge but really do need the assistance. vba ms-word word-vba share|improve this question edited Mar 29 at 14:15 Ben Rhys-Lewis 2,25781434 asked Jan 5 at 17:12 Dwayne Bellot 1 Can you elaborate on what the expected behavior is and what the actual output is? Does the script fail, output the wrong info, something else? &nd
Technology and Trends Enterprise Architecture and EAI ERP Hardware IT Management and Strategy Java Knowledge Management Linux Networking Oracle PeopleSoft Project and Portfolio Management SAP SCM Security Siebel Storage UNIX Visual Basic Web Design and Development Windows < Back CHOOSE A DISCUSSION GROUP Research Directory TOPICS Database Hardware Networking SAP Security Web Design MEMBERS Paul_Pedant DACREE MarkDeVries MacProTX VoIP_News Inside-ERP Inside-CRM I_am_the_dragon maxwellarnold Michael Meyers-Jouan TerryCurran Chris_Day Andrew.S.Baker Ramnath.Awate JoeTorre Locutus Craig Borysowich Dennis Stevenson mircea_luca Richard DukeGanote iudithm Clinton Jones bracke Nikki Klein AbhaiTripathi Iqbalyk jakarman Adrian_Grigoriu knowscognosdoi COMPANIES Sophos EdgeWave Skybot Software Epicor Software ... View All Topics View All Members View All Companies Toolbox for IT Topics Visual Basic Groups Ask a New Question Visual Basic for Applications A forum where peers share technical expertise, solve problems, and discuss issues related to the use of Visual Basic for Applications (VBA). Home | Invite Peers | More Visual Basic Groups Your account is ready. You're now being signed in. Solve problems - It's Free Create your account in seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy. Runtime Error 5941 The Requested Member of the Collection Does Not Exist BernRI asked Dec 8, 2013 | Replies (5) Every time I run this macro Sub KitLabels() ' ' KitLabels Macro ' Macro recorded 9/28/2009 by MVP ' ActiveDocument.MailMerge.DataSource.QueryString = _ "SELECT * FROM `'Credit Card Data$'` WHERE `Kit 1` = '12/15/13' ORDER BY `Child's Last Name` ASC ,`Child's First Name` ASC " _ & "" With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .MailAsAttachment = False .MailAddressFieldName = "" .MailSubject = "" .SuppressBlankLines = True With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .Execute Pause:=True End With Windows("Kit Label Framework.docx").Activate ActiveDocument.MailMerge.DataSource.QueryString = _ "SELECT * FROM `'Credit Card Data$'` WHERE `Kit 2` = '12/15/13' ORDER BY `Child's Last Name` ASC ,`Chi