Home > Runtime Error > Microsoft Visual Basic Runtime Error 4608

Microsoft Visual Basic Runtime Error 4608

Contents

Member Login Remember Me Forgot your password? The code works in 2003, 2007 and 2010 but in 2013 I get "Run-time error '4608': Value out of range" at the point the code attempts to add a table to Works great 95% of the time. more hot questions question feed lang-vb about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation http://discusswire.com/runtime-error/microsoft-visual-basic-runtime-error-53-file-not-found.html

Many thanks, John Code: Sub ReportGenerate() ' Variable declarations Dim WordApp As Object Dim i As Integer Dim SaveAsName As String Dim TableCount As Integer TableCount = 0 Dim rng As There are several documents that use this macro. Formatted all the pieces to have the same format which meant that the collection didn't have to run the macro. –dbasnett Apr 4 at 11:33 | show 2 more comments Your The larger ones have more than the smaller ones. navigate to this website

Microsoft Visual Basic Runtime Error 4608

Privacy Policy Site Map Support Terms of Use Search Forums Show Threads Show Posts Tag Search Advanced Search Go to Page... Code: ' ============================================================================ ' === Remove First Page Headers and Footers, and set Odd / Even footers === ' ============================================================================ ActiveWindow.ActivePane.View.Type = wdPrintView Selection.GoTo What:=wdGoToSection, Which:=wdGoToFirst, Name:="" ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter Sub PlainPrint_B() Dim sec as Section ' ' PlainPrint-B Macro ' Prints to Aficio 2075-B, Plain paper ' ' Get active/default printer.

I have another macro for pre-printed letterhead that does the same thing except the .OtherPagesTray point to different tray. A ring in which the two operations are equal is {0} What exactly do the items Last Whisper and Void Staff do? Thanks again. Yes, I can comment out that line, but then it fails on the next line, the Odd AndEvenpagesHeaderFooter property.

It took .5 hours to format the two documents, two of the smallest, in the link above. Runtime Error 4608 When Printing We > > have Word 2003 and our printer is an HP Laserjet 4250. > > > > Selection.WholeStory > > With ActiveDocument.PageSetup > > .FirstPageTray = 262 > > .OtherPagesTray strActivePrinter = Application.ActivePrinter 'Change the active printer to match local Aficio 2075-B ActivePrinter = "\\circe\Aficio 2075-B PCL6" For each sec in ActiveDocument.Sections Close Box Join Tek-Tips Today!

No variables are outside of boundaries that I'm aware of. Small document - <= 256KB Large document - >= 500KB For the documents that have the error I can open them in Word and manually make the settings without a problem. But if the section breaks are necessary then there are ways to correct the document. Oracle flashback query syntax - all tables to same timestamp Client requesting admin work Multi-line group capturing between braces Positional Bathroom Etiquette Why cast an A-lister for Groot?

  1. For example integers cannot exceed 32767.
  2. Your cache administrator is webmaster.
  3. First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone.
  4. With ActiveDocument.Sections(1) .PageSetup.DifferentFirstPageHeaderFooter = True .Footers(wdHeaderFooterPrimary).PageNumbers.Add _ FirstPage:=True End With Doing it this way may help.
  5. Click Here to join Tek-Tips and talk with other members!
  6. Register now while it's still free!
  7. All the best, thanks 0 LVL 5 Overall: Level 5 Message Active 1 day ago Expert Comment by:Mdlinnett2012-10-15 This solution has got me out of a bind aswell.
  8. Your name or email address: Do you already have an account?

Runtime Error 4608 When Printing

Basically the code sits in an Excel workbook which generates a report in Word, using Word VBA of course, populating it with the contents of a worksheet which was itself populated Function pagestuffB() As String ' ' Format for Publisher ' ' Dim rv As String rv = "" On Error GoTo ErrorHndlr: With Application .Options.Pagination = False .ScreenUpdating = False .WindowState Microsoft Visual Basic Runtime Error 4608 Subscribe to our monthly newsletter for tech news and trends Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource Center About Us Who We I tried using it and it did have a window showing paper sizes, but I didn't really know what to do with the information.

For smaller documents the macro runs without error, for larger documents we receive the error in the subject line of this thread. http://discusswire.com/runtime-error/runtime-error-in-c.html Already a member? That's why the site is here. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient?

Application.ActivePrinter = strActivePrinter End Sub This link details a method for discovering the actual tray numbers: http://www.experts-exchange.com/Applications/MS_Office/Word/Q_21008239.html 0 LVL 38 Overall: Level 38 MS Word 1 Message Active today Author I then copied the code from this test macro over the statements in my actual script and it seems to be working now. If you read articles published by MS Word MVPs you will see a common theme that they recommend working with the underlying objects instead of using Selection object and View.SeekView whenever http://discusswire.com/runtime-error/microsoft-word-runtime-error.html What I found was that there is an attribute in each section which has the XML of or similar this XML can usually be found just before .

It seems like you used a recorded macro to build this code. To start viewing messages, select the forum that you want to visit from the selection below. Below is the text of the macro Sub PlainPrint_B() ' ' PlainPrint-B Macro ' Prints to Aficio 2075-B, Plain paper ' ' Get active/default printer.

Similar Threads run-time error '4608' value out of range grant thomas, Aug 15, 2003, in forum: Word VBA Replies: 0 Views: 760 grant thomas Aug 15, 2003 Run-time Error '4608' Value

But testing another similar document the macro worked even with a "section break next page" in place?? im using word 2003 ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True Set oRng = ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range oRng.ParagraphFormat.Alignment = wdAlignParagraphCenter NormalTemplate.AutoTextEntries("Page X of Y").Insert Where:=oRng, RichText:=True Casey Mac, Nov 1, 2005 #2 Advertisements Jean-Guy Marcil Guest Why is this C++ code faster than assembly? How would you set up the section handling if only the first page of the document goes to tray 1 and all the rest (regardless of sections) goes to tray 2.

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 Did you try to comment out the offending line to see if the code will run without it? Will I encounter any problems as a recognizable Jew in India? http://discusswire.com/runtime-error/runtime-error-c.html If so, please mark it as answered to close the question.

Join UsClose PageSetup + Section Breaks = Value out of range Run-time Error 4608 From: "Rich" Date: Wed, 25 Jul 2007 21:43:35 +0100 Hi All, I have seen this problem I found this documentation in Word: Use the DifferentFirstPageHeaderFooter property with the PageSetup object to specify a different first page. Coding Standard - haphazard application Achieve same random number sequence on different OS with same seed How can tilting a N64 cartridge causes such subtle glitches? Privacy policy About HotDocs Wiki Disclaimers Cavendish Skin Login with LinkedIN Or Log In Locally Email Password Remember Me Forgot Password?Register ENGINEERING.com Eng-Tips Forums Tek-Tips Forums Search Posts Find A

Login. And more importantly, how to fix it? The Function so I could use Interop and execute it from a VS app. –dbasnett Mar 21 at 23:55 Do the documents that fail have multiple sections? –Comintern Mar strActivePrinter = Application.ActivePrinter 'Change the active printer to match local Aficio 2075-B ActivePrinter = "\\circe\Aficio 2075-B PCL6" For Each sec In ActiveDocument.Sections

If it is section breaks how can I get the macro to work around/with them? You may have to register before you can post: click the register link above to proceed. Password Home Register Calendar Today's Posts FAQ Free Publications Search Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Send… MS Office Outlook MS Word Office / Productivity Creating an MLA Formatted Paper with Citations and a Bibliography Video by: Tony This video walks the viewer through the process of

I tried using it and it did > have a window showing paper sizes, but I didn't really know what to > do with the information. Sometime's my letter has different margins, etc. (I'm assuming this is the problem) and because of this I get a Run-time error '4608: Value out of range error. Join Now For immediate help use Live now! Is there a way to load the ShowConfig before Sitecore finishes initializing?

You would think that if the 'line-pitch' was visible in the XML then there would be some where in Word that you could set this value.