Microsoft Visual Basic Runtime Error 4248
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Wed, 19 Oct 2016 04:39:57 GMT by s_ac4 (squid/3.5.20)
soon) Ruby (coming soon) Getting Started Code Samples Resources Patterns and Practices App Registration Tool Events Podcasts Training API Sandbox Videos Documentation Office Add-ins Office Add-in Availability Office
Run Time Error 4605 Visual Basic
Add-ins Changelog Microsoft Graph API Office 365 Connectors Office 365 REST APIs run-time error '5941' application-defined or object-defined error SharePoint Add-ins Office UI Fabric Submit to the Office Store All Documentation https://www.yammer.com/ http://feeds.feedburner.com/office/fmNx Ask a question Quick access run-time error 4605 excel Forums home Browse forums users FAQ Search related threads Remove From My Forums Asked by: Run-time error 4248 when opening a Word document with a double click in Access Microsoft Office http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/i-have-multiple-word-documents-on-i-get-a-error/c0b45ead-4c32-4da3-afb2-96fc8b690f11 for Developers > Access for Developers Question 0 Sign in to vote Hi, I'm working with Office 2007 and 2010. I have a Word template which performs some checking on the document (based upon it) when it is opened. In different points it uses the ActiveDcument propiety. When I open the document normally, everything OK When I open the document from Access https://social.msdn.microsoft.com/Forums/office/en-US/ebad1fae-b779-4470-9ce8-36f956ffc46e/runtime-error-4248-when-opening-a-word-document-with-a-double-click-in-access?forum=accessdev using the following code, it is also OK: Dim objWordApp As Word.Application Dim objWordDoc As Word.Document Set objWordApp = CreateObject("Word.Application") With objWordApp .Visible = false ' or True .Documents.Open("MYDoc.docx") End With But when I double click the bound object frame (OLE) in an Access frame, Word will generate an error when it encounters the ActiveDocument reference. Run-time error '4248': This command is not available because no document is open. Could you explian me why? And suggest some work around? Lauro P.S.: I noticed that Application.UserControl is TRUE (in the two first cases; and False in the last) [strange! I would have tought that in the second one would it be false...] Edited by Lauro2 Thursday, August 16, 2012 10:08 PM Moved by Leo_GaoModerator Wednesday, August 22, 2012 2:42 AM (From:Word for Developers) Thursday, August 16, 2012 10:06 PM Reply | Quote All replies 0 Sign in to vote hi, I have an Access (2007 or 2010) database; in a form I have a bound object frame wich contains a Word (2007 or 2010) file. The Word documents are based on a MyTemplate, which uses ActiveDoc
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 http://stackoverflow.com/questions/12037139/normal-dotm-macro-throws-error-opening-protected-document About Us Learn more about 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 http://www.msofficeforums.com/excel-programming/19758-run-time-error-4248-when-opening-word.html the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Normal.dotm macro throws error time error opening protected document up vote 1 down vote favorite I added the following macro to my Normal.dotm for Word 2010: Sub AutoOpen() ' ' AutoOpen Macro ' ' Dim aStory As Range Dim aField As Field For Each aStory In ActiveDocument.StoryRanges For Each aField In aStory.Fields aField.Update Next aField Next aStory ' set document as unchanged (prevents save dialog popping up when closing) - further changes run time error will set this back ActiveDocument.Saved = True End Sub Now when I open some documents in Word 2010, I get the following error message: Run-time error '4248' This command is not available because no document is open So far this seems to occur for files that are opened in Protected view (e.g. files downloaded from the internet, or email attachments) - if I switch off Protected view in the Trust Centre the problem goes away. ms-word word-vba share|improve this question edited Dec 19 '15 at 18:27 Community♦ 11 asked Aug 20 '12 at 11:52 dunxd 4702926 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote Microsoft wrote a blog entry on detecting whether Protected Mode is running from within a macro. This shows that the value of Application.ActiveProtectedViewWindow is Nothing when a document is not in Protected View. So wrapping the macro functions that refer to ActiveDocument in If statements checking for this will prevent those functions from running when the document is in Protected view. The above script becomes: Sub AutoOpen() ' ' AutoOpen Macro ' ' Dim aStory As Range Dim aField As Field ' Check
Search Go to Page... LinkBack Thread Tools Display Modes #1 02-13-2014, 01:33 PM CIF Windows 7 32bit Office 2007 Novice Join Date: Feb 2014 Posts: 7 Run Time Error 4248 when opening Word Doc from Excel I haved a pricing worksheet that our workgroup uses. It opens a Word Document from and Excel Worksheet and merges info from Excel to Word. It worked fine while everyone was using Office 2007. The users that have Office 2010 installed on their computers are getting a Run Time Error 4248 when they attempt to create the Word document from the Word Template. Here is a piece of the VBA code in the Excel worksheet. Code: Dim wrdApp As Word.Application Set wrdApp = CreateObject("Word.Application") Application.ScreenUpdating = False With wrdApp .Documents.Add Template:="G:\ABP\ArchSpec\A-Operations\Group Templates\Quote Templates\MWLinearQuote.dotx" Any help would be very much appreciated. #2 02-15-2014, 09:15 PM macropod Windows 7 32bit Office 2010 32bit Administrator Join Date: Dec 2010 Location: Canberra, Australia Posts: 14,270 That error usually occurs when you try to do something with a document that hasn't opened. In this case, that could be because Word can't find the referenced template. Can the affected users access the template by inserting the path as coded into Windows Explorer? __________________ Cheers, Paul Edstein [MS MVP - Word] #3 02-16-2014, 12:01 PM CIF Windows 7 32bit Office 2007 Novice Join Date: Feb 2014 Posts: 7 They can, but then it doesn't populate correctly. #4 02-16-2014, 02:25 PM macropod Windows 7 32bit Office 2010 32bit Administrator Join Date: Dec 2010 Location: Canberra, Australia Posts: 14,270 Quote: Originally Posted by CIF They can, but then it doesn't populate correctly. Granted, but that wasn't the point of the question, which was to establish that Word 2010 correctly creates a document from the template. That being established, which code line, if any, is highlighted when you get the 4248 error? __________________ Cheers, Paul Edstein [MS MVP - Word] #5 02-16-2014, 02:56 PM CIF Windows 7 32bit Office 2007 Novice Join Date: Feb 2014 P