Microsoft Visual Basic Run-time Error 4198
Contents |
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 Reputation 40 Reply leena beeharry (leena) runtime error 4198 command failed Posted: 9/25/2002 9:54 AM rated by 0 users Help,I keep getting the 4198 runtime
Error 4198 Word 2010
error when attempting to run the following code. I've no idea why. :(I would be grateful for any help;thanks in
Runtime 4198
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
Excel Vba Runtime Error 4198
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 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 the macros.the line the code actually falls over on in the 'ActiveDocument.SaveAs.....' line. It won't go any further.Any help would be appreciated.:thumb:Leena | Post Points: 5 rjhare England Since 6/13/2001 Posts 2,436 Reputation 35,017 Reply rjhare (rjh
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 http://vbcity.com/forums/t/11162.aspx 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 http://www.tek-tips.com/viewthread.cfm?qid=1481299 - 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 understand why it is failing here.The full code in this section is (problem line hi-lited):CODESub ender3()For Each aField In ActiveDocument.FormFieldsCount = Count + 1Next aFieldFor j = 1 To CountActiveDocument.FormFields(j).SelectWith Selection.Find.Text = "0".ClearFormatting.Replacement.Text = "&
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the http://stackoverflow.com/questions/25247849/vba-error-4198-runtime-error-with-paste workings and policies of this site About Us Learn more about http://www.xtremevbtalk.com/word-powerpoint-outlook-and-other-office-products/322720-error-4198-document-word-2010-a.html 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 6.2 million programmers, just like you, helping each other. error 4198 Join them; it only takes a minute: Sign up VBA Error 4198 “Runtime Error” With Paste up vote 0 down vote favorite I have been trying to write a word VBA script that uses a screenshot (already copied to the clipboard) and pastes it into a word document to be formatted and saved. The program works great on my runtime error 4198 computer at work, but when I distributed it to others, it failed to work on about 25% of the computers. The error that I received was "4198 Runtime Error". I have searched for similar problems that other people have had, but I am still at a loss. All of the computers in the office run the same version of work, 2010 standard version. The issue is with the very last line of code, selection.paste. I did make sure that they had a screenshot on their clipboard before running the script. Thank you so much for any and all input. Sub MapMaker() 'set up new document with narrow margins and landscape orientation With Selection.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = InchesToPoints(0.5) .BottomMargin = InchesToPoints(0.5) .LeftMargin = InchesToPoints(0.5) .RightMargin = InchesToPoints(0.5) .Gutter = InchesToPoints(0) .HeaderDistance = InchesToPoints(0.5) .FooterDistance = InchesToPoints(0.5) .PageWidth = InchesToPoints(8.5) .PageHeight = InchesToPoints(11) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .Boo
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 Grace Join Date: Mar 2005 Location: Nazareth Posts: 1,697 Error 4198 on document.open - Word 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 _ :="", 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 - 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 e