Microsoft Visual Basic Error 4248
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 17:51:48 GMT by s_wx1126 (squid/3.5.20)
VBA Code & Other Help Word Help Run-time error '4248': this command is not available because no document is open If this is your first visit, be sure
Run Time Error 4605 Visual Basic
to check out the FAQ by clicking the link above. You may run-time error '5941' application-defined or object-defined error have to register before you can post: click the register link above to proceed. To start viewing
Run-time Error 4605 Excel
messages, select the forum that you want to visit from the selection below. Page 1 of 2 1 2 Last Jump to page: Results 1 to 20 of 21 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 Thread: Run-time error '4248': this command is not available because no document is open Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 04-04-2012,01:45 PM #1 midani View Profile View Forum Posts View Blog Entries View Articles VBAX Regular Joined Apr 2012 Posts 10 Location Run-time error http://www.vbaexpress.com/forum/showthread.php?41659-Run-time-error-4248-this-command-is-not-available-because-no-document-is-open '4248': this command is not available because no document is open Hello my document is attached. I keep getting this error on Windows XP SP3 behavior is like this: 4248 referenced in title block above. If I click "End" on the error window, the macros ran. They didn't work right, though, because the boxes didn't check. If I choose Debug, then the Visual Basic page shows up and highlights the first half-line of the programing. Any ideas? Thanks, Midani Private Sub Document_Open() If ActiveDocument.FormFields("text64").Result = "Yes" Then ActiveDocument.FormFields("Check1").CheckBox.Value = True If ActiveDocument.FormFields("text64").Result = "No" Then ActiveDocument.FormFields("Check2").CheckBox.Value = True Formatting tags added by mark007 [COLOR=#000000]If ActiveDocument.FormFields("text65").Result = "Inpatient" Then ActiveDocument.FormFields("Check3").CheckBox.Value = True If ActiveDocument.FormFields("text65").Result = "ER/Outpatient" Then ActiveDocument.FormFields("Check4").CheckBox.Value = True If ActiveDocument.FormFields("text65").Result = "DOA" Then ActiveDocument.FormFields("Check5").CheckBox.Value = True If ActiveDocument.FormFields("text65").Result = "Nursing Home" Then ActiveDocument.FormFields("Check6").CheckBox.Value = True If ActiveDocument.FormFields("text65").Result = "Hospice" Then ActiveDocument.FormFields("Check7").CheckBox.Value = True If ActiveDocument.FormFields("text65").Result = "Residence" Then ActiveDocument.FormFields("Check8").CheckBox.Value = True If ActiveDocument.FormFields("text65").Result = "Other (Specify)" Then ActiveDocument.FormFields("Check9").CheckBox.Value = True[/COLOR] [COLOR=#000000]If ActiveDocument.FormFields("text66").Result = "Married" Then ActiveDocument.FormFields("Check10").CheckBox.Value = True If ActiveDocument.FormFields("text66").Result =
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 http://stackoverflow.com/questions/12037139/normal-dotm-macro-throws-error-opening-protected-document Us Learn more about Stack Overflow the company Business Learn more about hiring http://www.vbforums.com/showthread.php?612343-RESOLVED-This-command-is-not-available-because-no-document-is-open-Error-code-4248 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. Join them; it only takes a minute: Sign up Normal.dotm macro throws error opening protected time error 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 will set run time error 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 that document is not in Prot
because no document is open. Error code 4248 If this is your first visit, be sure to check out the FAQ by clicking the link 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 4 of 4 Thread: [RESOLVED] This command is not available because no document is open. Error code 4248 Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Apr 23rd, 2010,10:41 AM #1 but43r View Profile View Forum Posts Thread Starter New Member Join Date Apr 2010 Posts 3 [RESOLVED] This command is not available because no document is open. Error code 4248 Hi, I have a web application that used to be hosted on Server 2003 and IIS6, recently the web application was moved to Server 2008 R2 and IIS7.5 and now is just wont work. I just give me this error. This command is not available because no document is open.4248 Here is the code that causes it to throw that error and I have marked specific line with ----> where it crashes. Dim wdApp ' Create the word object Set wdApp = Server.CreateObject("Word.Application") if Err.number <> 0 Then nErr = 1 szErr = " Error creating the Word Object " & Err.Description Exit sub End if ' Open the Template document wdApp.Documents.Open sSourcePath if Err.number <> 0 Then nErr = 1 szErr = " Error Opening the template document " & sSourcePath & " " & Err.Description Exit sub End iF Dim arrTags, arrValues Dim iLoop ' Organise the Strings arrTags = Split(sTags, ", ") arrValues = Split(sValues, " | ") Loop over the strings pulling out the assigned values For iLoop = 0 To UBound(arrTags) -----> wdApp.ActiveDocument.Content.Find.Execute arrTags(iLoop), , True, , _ , , , , , arrValues(iLoop), 2 if Err.number <> 0 Then