Error 4198 Word Vba
Contents |
Word Macro when ActiveDocument.SaveAs rated by 0 runtime error 4198 command failed users This post has 4 Replies | 1 Follower leena
Runtime Error 4198 Word 2010
cardiff, Wales Since 9/25/2002 Posts 2 Reputation 40 Reply leena beeharry (leena) Posted: 9/25/2002 run time error 4198 word 2010 9:54 AM rated by 0 users Help,I keep getting the 4198 runtime error when attempting to run the following code. I've no idea error 4198 command failed word 2007 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" Thenlocation = Mid(prop, 28)End IfWendClose #1'select the entire document so that bookmarks can be found
Runtime 4198
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 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 answ
360 games PC games microsoft visual basic runtime error 4198 Windows games Windows phone games Entertainment All Entertainment excel vba runtime error 4198 Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://vbcity.com/forums/t/11162.aspx 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 https://support.microsoft.com/en-us/kb/275558 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 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 http://stackoverflow.com/questions/8022533/excel-mail-merge-run-time-error-4198 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, http://www.tek-tips.com/viewthread.cfm?qid=1481299 just like you, helping each other. Join them; it only takes a minute: Sign up Excel Mail Merge run time error 4198 up vote 4 down vote favorite 1 There was a previous question on stackoverflow: "Is error 4198 it possible to start MAIL MERGE from excel macro (by clicking a button on sheet) I have excel sheet with data and want to export it to new word doc." This was answered Sep 29 '09 at 12:39 by dendarii 772. We had this need too because we wanted to simplify life for volunteers with limited computer skills. Unfortunately dendarii's code, modified with a suitable path, exits with run time error 4198 at the time error 4198 .OpenDataSource statement. Cindy Meister writing on Microsoft Office for Developer's Form> ..>Word 2010 VBA suggested 4198 errors could be due to synchronicity problems. I gave it go with no success. Andrew Poulson writing on Mr Excel encourages a contributor Snecz to compare his VBA mail merge .OpenDataSource statement against a Word macro recording. What do contributors think? My .OpenDataSource line seems standard. My Excel datasource file has a line of headers followed by two lines of data elements. We have Office 2010. I would be very grateful for any suggestions as to how to fix 4198 and if anyone knows of general diagnostic procedures. We are two people working for a charitable organisation. Any help welcome! Sub RunMerge() Dim wd As Object Dim wdocSource As Object Dim strWorkbookName As String On Error Resume Next Set wd = GetObject(, "Word.Application") If wd Is Nothing Then Set wd = CreateObject("Word.Application") End If On Error GoTo 0 Set wdocSource = wd.Documents.Open("C:\Users\george\Desktop\VBA Project\Mergeletter.docx") strWorkbookName = ThisWorkbook.Path & "\" & ThisWorkbook.Name wdocSource.MailMerge.MainDocumentType = wdFormLetters wdocSource.MailMerge.OpenDataSource _ Name:=strWorkbookName, _ AddToRecentFiles:=False, _ Revert:=False, _ Format:=wdOpenFormatAuto, _ Connection:="Data Source=" & strWorkbookName & ";Mode=Read",
Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us! Are you aComputer / IT professional?Join Tek-Tips Forums! Talk With Other Members Be Notified Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite Forums Automated SignaturesOn Your Posts Best Of All, It's Free! Join Us! *Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.Tek-Tips Posting Policies Jobs Jobs from Indeed What: Where: jobs by Link To This Forum! Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.Just copy and paste the BBCode HTML Markdown MediaWiki reStructuredText code below into your site. VBA Visual Basic for Applications (Microsoft) Forum at Tek-Tips HomeForumsProgrammersLanguagesVBA Visual Basic for Applications (Microsoft) Forum Error 4198 - Command Failed thread707-1481299 Forum Search FAQs Links MVPs Error 4198 - Command Failed Error 4198 - Command Failed WalkerEvans (TechnicalUser) (OP) 18 Jun 08 12:13 Hi!Can anyone shed some light on this?I am getting the following error:Run-time error '4198'Command FailedThis is showing up at the bottom of a macro that opens a Word document, allows changes to be made, prints and deletes that document and then opens a form-field document which is then printed and closed (in theory).The problem is that I keep getting the above error after everything but the close is done, leaving me with an open form-field document containing sensitive data.What we have here should be simple; I've used this same line in many other macros and it has worked flawlessly.I'm at a loss to unde