Error Number 5941
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 14 Oct 2016 08:38:40 GMT by s_ac15 (squid/3.5.20)
here for a quick overview of the site Help Center
Runtime Error 4248 Word 2013
Detailed answers to any questions you might have Meta run time error 5941 word 2013 Discuss the workings and policies of this site About Us Learn more about Stack Overflow
Run Time Error 4605 Visual Basic
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/run-time-error-5941-not-always-but-annoyingly/b95ec1db-6928-4d87-b799-52d4f1c01f08 x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 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 Exist up vote -1 down vote favorite http://stackoverflow.com/questions/30705042/runtime-error-5941-the-requested-member-of-collection-does-not-exist 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").Range.Fields(1).Result.Text = Windows(SourceTemplateName).Document.Bookmarks("fCust").Range.Fields(1).Result.Text ' Populate Version Windows(DestTemplateName).Document.Bookmarks("fVersion").Range.Fields(1).Result.Text = Windows(SourceTemplateName).Document.Bookmarks("fRevision").Range.Fields(1).Result.Text ' Populate Entered Onto CRM Windows(DestTemplateName).Document.Bookmarks("fEnteredOntoCRM").Range.Fields(1).Resul
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta http://stackoverflow.com/questions/34617417/5941-error-the-requested-member-of-the-collection-does-not-exist-word-macro Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, time error 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 far from a programmer however i need assistance finding out the error with this VBA script. It is run in a word document runtime error 4248 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 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") = Seria