Error 4198 Command Failed
Contents |
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office run time error 4198 command failed Add-in Availability Office Add-ins Changelog Microsoft Graph API Office 365 Connectors Office error 4198 command failed vba 365 REST APIs SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx error 4198 word 2010 Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Word 2010 VBA: Run-time error '4198' Command Failed - MailMerge
Error 4198 Command Failed Word 2007
Microsoft Office for Developers > Word for Developers Question 0 Sign in to vote I have written a function in Excel 2010 using VBA that performs a mail merge in Word 2010 using a CSV file that I generatedwith data from the Excel workbook. Function EmailVerstuurd() As Boolean Dim appWord As Word.Application Dim blnRunning As Boolean Dim doc As microsoft visual basic runtime error 4198 Document Dim strEmailInloggen As String Dim strRegje As String Dim i As Integer, rMail As Range Dim secAutomation As MsoAutomationSecurity 1 On Error GoTo Err_handler 'Capture the name of the procedure for debugging purposes 2 strProcedure = "EmailVerstuurd" 'Full path of mail merge main document 3 strEmailInloggen = "V:\Opleiding\Bedrijfsopleidingen\Typecursus\Procedures\Email inloggegevens nieuwe gebruiker.doc" 'Check if an instance of Word is already running 4 If modCode.IsAppRunning("Word.Application") Then 5 Set appWord = GetObject(, "Word.Application") 6 blnRunning = True 7 Else 8 Set appWord = CreateObject("Word.Application") 9 End If 'If necessary set registry key kb825765 / http://vba-corner.livejournal.com/3054.html 10 strRegje = "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Options\SQLSecurityCheck" 11 If Not modFunctions.RegKeyExists(strRegje) Then 12 modFunctions.RegKeySave strRegje, "00000000", "REG_DWORD" 13 End If 'Put security to low kb886633 14 secAutomation = appWord.AutomationSecurity 15 appWord.AutomationSecurity = msoAutomationSecurityLow 'Open mail merge main document 16 Set doc = appWord.Documents.Open(FileName:=strEmailInloggen) 'Perform the mail merge - send email to selected recipients 17 With doc.MailMerge 18 .OpenDataSource Name:=ActiveWorkbook.Path & "\" & "Import_TypingMaster.csv" 19 .Destination = wdSendToEmail 20 .MailAsAttachment = False 21 .MailSubject = "Inloggevens online typecursus" 22 .MailAddressFieldName = "student_email" 23 .Execute 24 Ema
VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > Error 4198 on document.open - Word 2010 only! Thread Tools Display Modes #1 11-17-2011, 01:45 AM George7a Saved by runtime 4198 Grace Join Date: Mar 2005 Location: Nazareth Posts: 1,697 Error 4198 on document.open - Word
Excel Vba Runtime Error 4198
2010 only! Hi All, I am getting error 4198 in one of the PCs that has office 2010 on it. I know that the error is on the document.open command: Code: Dim objWdApp As Object Set objWdApp = CreateObject("Word.Application") objWdApp.Visible = False objWdApp.ChangeFileOpenDirectory local_tmp + "\" objWdApp.Documents.Open FileName:=App.Path & "\" & filename, ConfirmConversions:=False, ReadOnly _ :=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _ :="", https://social.msdn.microsoft.com/Forums/office/en-US/99af2bc9-d2ee-4036-9901-afbc4c1b1174/word-2010-vba-runtime-error-4198-command-failed-mailmerge?forum=worddev Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _ , Format:=0 This code has been working on office 2000,2002,2003,2007 & 2010. But it doesn't work in some specific PCs that I do not have any idea what is special about them. The full error message is: Quote: Error number:4198. Command failed 36966. 0. wdmain11.chm. Microsoft Word Any ideas how to solve this? I have been searching for a clue, and found nothing useful. - George __________________ Read Matthew 24: 3-14 - http://www.xtremevbtalk.com/word-powerpoint-outlook-and-other-office-products/322720-error-4198-document-word-2010-a.html sounds familiar? Escape This - The Best Escape Games Ever! | Games Walkthrough Technology Videos Angry Birds Star Wars Walkthrough George7a View Public Profile Find all posts by George7a #2 11-18-2011, 05:45 AM Jupiter 2 Centurion Join Date: May 2009 Location: Australia Posts: 101 I'm not particularly up to date with the code but local_tmp does not seem to be a valid variable. If you are trying to run the macro on a PC that hasn't been used to create the macro in the first place then the temp files created by the VB Editor will not have been made and any undeclared variables will cause errors. Also, Word 2007 and 2010 use .docx extensions and if you are still using .doc extension then the error could be in any formatting you may have done in the latter versions when the document was prepared. __________________ If all my Answers are wrong, only then will I read the Question Jupiter 2 View Public Profile Visit Jupiter 2's homepage! Find all posts by Jupiter 2 #3 11-22-2011, 12:18 AM George7a Saved by Grace Join Date: Mar 2005 Location: Nazareth Posts: 1,697 Thanks for the reply. Sorry, I missed the declaration of the local_tmp. it should have been up there. My code has it and I still get the error. It is not a ma
Word Macro when ActiveDocument.SaveAs rated by 0 users This post has 4 Replies | 1 Follower leena cardiff, Wales Since 9/25/2002 Posts 2 http://vbcity.com/forums/t/11162.aspx Reputation 40 Reply leena beeharry (leena) Posted: 9/25/2002 9:54 AM rated by 0 http://stackoverflow.com/questions/18516892/vba-word-2010-paste-error-no-wait-command users Help,I keep getting the 4198 runtime error when attempting to run the following code. I've no idea why. :(I would be grateful for any help;thanks in advanceLeena/*********** CODE ***********************/Private Sub Document_Open()Dim prop As StringOpen "C:\Speed2001Installation.Properties" For Input As #1While Not EOF(1)Line Input #1, propIf Left(prop, 24) = "INSTALLATION_LOC_REPORTS" error 4198 Thenlocation = Mid(prop, 28)End IfWendClose #1'select the entire document so that bookmarks can be found and table of contents generated laterSelection.WholeStorySelection.Fields.UpdateSelection.HomeKey Unit:=wdStory'InsertSpreadsheets'Move to the top of the doc before saving..Selection.HomeKey Unit:=wdStorysaveAsLocation = location + "\data\rapid\reports" & "\mnds"'Save the document to the users default word folder..ActiveDocument.SaveAs fileName:=saveAsLocation, _FileFormat:=wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, _WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=FalseEnd Sub/************** END OF CODE *******************/ | Post error 4198 command Points: 35 rjhare England Since 6/13/2001 Posts 2,436 Reputation 35,017 Reply rjhare (rjhare) replied on 10/3/2002 12:25 AM rated by 0 users leenaError 4198 is usually associated with the VBa hyperlinks object - do you have any in your document? Also what line does it stop at when you step through on the debugger?For more help, follow this link:Error 4198 Sorry it took so long to get a reply from us - I have only just seen the post :oAny more help or advice, come back and I will answer as quick as I can :thumb: Criticism comes easier than CraftmanshipWhilst I try and answer every thread there is, I find most of my answers to your posts here:[Posting Guidelines] | [FAQ's] | [The Chosen One] | [Knowledge Search] | [Richie's Wisdom Forum] | Post Points: 5 leena cardiff, Wales Since 9/25/2002 Posts 2 Reputation 40 Reply leena beeharry (leena) replied on 10/3/2002 12:40 AM rated by 0 users Hi,thanks 4 the assistance,:Din reply to your questions, I have hyper links in my document but don't do anything with them or mention them in
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 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, helping each other. Join them; it only takes a minute: Sign up VBA Word 2010 Paste Error / No Wait Command up vote 0 down vote favorite I have a project that takes several documents as inputs, does some processing on them, and creates several new documents at the end. I am currently running into problems with pasting content from one Word document into another. The following code snippet seemed relevant: Set refOrigin = FindReference(OriginDoc) Set refDest = PasteDoc.Range(PasteDoc.Content.Start, PasteDoc.Content.End) refDest.Collapse wdCollapseEnd refOrigin.Copy refDest.Paste When running this code, I will occasionally get Run-time error 4198, Command Failed at the paste line in the code. However, when I go into the debugger, I can see that both refDest and refOrigin are valid ranges. Furthermore, when I step through the code line-by-line, it works. However, I can tell that in the instance where it failed, it inserted an embedded Word document already. I've done some research on the issues and I believe that there is some type of problem of the code running to fast for the clipboard to keep up with it sometimes. This makes sense to me because when I run the macro from a document on a network drive, it runs without a hitch. I thought that I would be able to simply add a wait command with Application.Wait, but it turns out that Word 2010 doesn't support this command; it's only in Excel. Does anyone have ideas as to the root of this problem, possible solutions, or any way to give Word 2010 a wait command? Thanks. vba wait word-vba paste share|improve this question asked Aug 29 '13 at 17:01 David Kelley 544623 1 chec