Excel Vba Error 4198
Contents |
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 runtime error 4198 command failed more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags error 4198 word 2010 Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, microsoft visual basic runtime error 4198 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 it possible to start runtime 4198 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 .OpenDataSource statement. Cindy Meister writing on
Error 4198 Vba
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", _   SQLStatement:="SELECT * FROM `Sheet1$`"  With wdocSource.MailMerge .Destination=wdSe
VBA Code & Other Help Excel Help [SOLVED] Excel Add In runtime error 4198 If this is your first visit, be sure to check out the FAQ by clicking the link
Excel Vba Runtime Error 4198
above. You may have to register before you can post: click 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 5 of 5 Thread: Excel Add In runtime error 4198 Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to http://stackoverflow.com/questions/8022533/excel-mail-merge-run-time-error-4198 Hybrid Mode Switch to Threaded Mode 10-17-2015,04:57 PM #1 CallMeMaybe View Profile View Forum Posts View Blog Entries View Articles VBAX Newbie Joined Oct 2015 Posts 3 Location Excel Add In runtime error 4198 First off...Sorry for my ignorance of the computer programming world. I am an end user, and have zero programming background. But I am good at understanding things http://www.vbaexpress.com/forum/showthread.php?54028-Excel-Add-In-runtime-error-4198 and taking directions, therefore I believe with a little guidance, I may be able to resolve my issue. For several years, I have been using an excel add-in, entitled ExcelToWord!, written by an author named dlmille. The add-in allows me to create MS Word templates with specified bookmarks, and merge excel spreadsheets into these templates to create MS Word documents. I have successfully been using it on multiple machines running windows 7, along with MS Office 2007. I finally upgraded some of my equipment, and find that this add-in does not function properly on my new computers. They are running windows 8.1, with the same clean install of MS Office 2007. The issue occurs when ExcelToWord! attempts to create the dotx document. I keep receiving the run-time error 4198. And my only options are to end or to debug. When I click debug, the follow code is highlighted, and I'm assuming that mean this is where the problem is... 'Note - FileFormat:= not needed - save in same format oWD.SaveAs Filename:=fPath & fBMName, _ LockComments:=False, Password:="", AddToRecentFiles:=True, _ WritePassword:="", ReadOnlyRecomm
Forum Microsoft Office Application Help - Excel Help forum Excel Programming / VBA / Macros [SOLVED] .SaveAs error for Word (Error 4198: Command Failed) To get replies by our experts at nominal charges, follow this link to http://www.excelforum.com/showthread.php?t=1100694 buy points and post your thread in our Commercial Services forum! Here is the FAQ for this forum. + Reply to Thread Results 1 to 4 of 4 .SaveAs error for Word (Error 4198: Command Failed) Thread Tools Show Printable Version Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode error 4198 08-24-2015,10:46 AM #1 hoboken View Profile View Forum Posts Registered User Join Date 08-11-2015 Location Hoboken, NJ MS-Off Ver 2010 Posts 2 .SaveAs error for Word (Error 4198: Command Failed) Hello, I have a long macro that fills out a table in Excel, then opens a Word document, pastes the table into it, and saves it to an inputted file path. I am getting an error on the last line runtime error 4198 of code, with a pop-up that states "Run-time error '4198': Command failed". I have no idea why, since I have basically this same exact code in another Excel file, and it runs fine without any errors. I've tried using Google to find a solution, but I've found nothing. I did read that this sometimes happens on Acer machines due to a cloud add-in, but I'm using a Dell machine. Any help would be appreciated! I will paste the last part of the code here: Please Login or Register to view this content. Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer Last edited by 6StringJazzer; 08-24-2015 at 11:30 AM. Register To Reply 08-24-2015,11:31 AM #2 6StringJazzer View Profile View Forum Posts Visit Homepage Forum Moderator Join Date 01-27-2010 Location Tysons Corner, VA, USA MS-Off Ver 2010, 2013, 2016 Posts 9,344 Re: .SaveAs error for Word (Error 4198: Command Failed) ":" is an illegal character in a Windows filename. Jeff Making the world a better place one fret at a time | | |·| |·| |·| |·| |