Error 5941 Vba
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Mon, 10 Oct 2016 04:59:56 GMT by s_ac15 (squid/3.5.20)
here for a quick overview of the site Help Center Detailed answers to any questions you might run-time error '5941' application-defined or object-defined error have Meta Discuss the workings and policies of this site About run time error 4605 word 2010 Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting
Runtime Error 4248 Word 2010
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 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 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 far from a programmer however i need assistance finding out the error with this VBA http://stackoverflow.com/questions/34617417/5941-error-the-requested-member-of-the-collection-does-not-exist-word-macro 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 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 b
is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click http://www.vbforums.com/showthread.php?626222-RESOLVED-Runtme-Error-5941 the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: [RESOLVED] Runtme Error 5941 Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Aug 30th, 2010,11:28 AM #1 NewVBer time error View Profile View Forum Posts Thread Starter Junior Member Join Date Jul 2009 Posts 27 [RESOLVED] Runtme Error 5941 Hello - I have created a Word template that will be used to generate a new document and I'm trying to populate a dropdown list with data from an Access table. I've tried different variations on the code but keep receiving errors. runtime error 4248 Specifically, I'm receiving the Runtime error "5941" The requested member of the collection does not exist. Below is the code and I've highlighted in red the line where the error occurs. I've tried using FormFields, I've tried ContentControls but cannot get it to work. I've checked the reference libraries and believe that I am using the correct ones. I'm running Word & Access 2007, and VBA 6.5. I'm using the followiing object libraries: Word & Access 12.0, Forms 2.0. I'm still pretty green at this so I would greatly appreciate any help...I'm sure it's something dumb that I'm just missing so thank you for your patience and assistance. Code: Dim cnt As New ADODB.Connection Dim rst As New ADODB.Recordset Dim strDB As String Set cn = New ADODB.Connection 'Set string path to database' strDB = "C:\---" 'Open the database to retrieve data cnt.Open "Provider=Microsoft.Ace.OLEDB.12.0;" & _ "Data Source=" & strDB & ";" 'Open recordset based on SelectedProjects Table rst.Open "Select * From SelectedProjects", cnt rst.MoveFirst Windows("Template1").Activate With ActiveDocument.FormFields("Dropdown1").DropDown.ListEntries .Clear Do .Add rst![ProjectName] rst.MoveNext Loop Until rst.EOF End With Reply With Quo