Error 4198 Vb6
Contents |
Word Macro when ActiveDocument.SaveAs rated by 0 users This runtime error 4198 command failed post has 4 Replies | 1 Follower leena cardiff, microsoft visual basic runtime error 4198 Wales Since 9/25/2002 Posts 2 Reputation 40 Reply leena beeharry (leena) Posted: 9/25/2002 9:54 AM
Error 4198 Word 2010
rated by 0 users Help,I keep getting the 4198 runtime error when attempting to run the following code. I've no idea why. :(I
Runtime 4198
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 and table of contents excel vba runtime error 4198 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
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 http://vbcity.com/forums/t/11162.aspx 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 - http://www.tek-tips.com/viewthread.cfm?qid=1481299 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 = "Ø".Replacement.ClearFormatting.Execute Replace:=wdReplaceAll, Forward:=TrueEnd WithNext jActiveDocument.FormFields(1).SelectActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=("xxxx")Count = 0Call GetOut2End SubSub GetOut2()'Prints form, reactivates Spell & Grammar'Checks, then closes form without SaveActiveDocument.PrintOutActiveDocument.ShowSpellingErrors = TrueActiveDocument.ShowGrammaticalErrors = TrueActiveDocument.Close
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire https://www.experts-exchange.com/questions/25985363/Runtime-Error-4198-In-Word-Macro-When-ActiveDocument-SaveAs.html for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Runtime Error 4198 In Word Macro When ActiveDocument.SaveAs Want to Advertise Here? Solved Runtime Error 4198 In Word Macro When ActiveDocument.SaveAs Posted on 2010-04-20 Visual Basic Classic MS Word VB error 4198 Script 1 Verified Solution 8 Comments 3,527 Views Last Modified: 2013-11-25 Hi, I am getting the error "Runtime Error 4198" In Word Macro when it hits the following code. If ActiveDocument.SaveFormat = 0 Or ActiveDocument.SaveFormat = 12 Then ActiveDocument.SaveAs _ filename:=strDocName(0) & ".pdf", _ runtime error 4198 FileFormat:=wdFormatPDF The problem is very hard to understand as I have the same set of macros running on four different computers, but its falling over on one only. I have run the msi from microsoft to fix the converting to pdf, but can't see why it falls over on one pc and not the others. Cheers, shane. 0 Question by:PrimedWebbie Facebook Twitter LinkedIn Google LVL 76 Active today Best Solution byGrahamSkan It might be worth trying the steps in this article http://support.microsoft.com/default.aspx/kb/921541 Go to Solution 8 Comments LVL 4 Overall: Level 4 Message Expert Comment by:akjain2010-04-20 have you tried this link (Error 4198) 0 Message Author Comment by:PrimedWebbie2010-04-21 Yeah i saw that but like i said its not happening on three other computers and there are no hyperlinks in the document. 0 LVL 76 Overall: Level 76 MS Word 65 Visual Basic Classic 39 VB Script 16 Message Active today Expert Comment by:GrahamSkan2010-04-21 Have you tried doing the same SaveAs manually? It might give you a more informative message than 'Command failed'. 0 LVL 8 Overall: Level 8 MS Word 8 Visu