Windows error: function execution error, solved in a minute. Windows error: function execution error, solved in a minute Configuration check unrecoverable error 1s 7.7

So, what is the point of my article?

1. There is a server (x64), with installed Office 2016 (x64), there is 1C 8.3.8 also x64 (meaning 1C server). Users connect via both a thin client and a web client.

2. There are a bunch of standard contracts and invoices issued (prepared) by the sales department. There is a font, a paragraph, etc., of course, everything is designed in Word, Excel 2016 (x64), naturally, there is no desire to draw all this in 1C, but there is a desire to put it in ActiveDocument format layouts

The solution seems banal :) , I won’t describe the whole mechanism, how it’s done, how data is filled from 1C into the ActiveDocument layout - I think you know this perfectly well without me. But during the work it turned out that not everything is so smooth in the realm of COM objects, namely:

2. Which option is better to choose: ActiveDocument or Binary Data? Although to me it sounds something like choosing Vodka With Beer or Beer With Vodka :) . No big deal, you need to fill the documents with data from 1C and transfer them to the Client.

Well, okay, let’s skip the lyrics, I choose ActiveDocument, I won’t describe the entire algorithm, I’ll just list the pitfalls and their solution. Everything stated below is my personal speculation and in no way claims to be the ultimate truth. You may have solved these problems or solved them differently.

1. Stone " first". The SaveAs method does not work (for both MSWord and MSExcel). When trying to write Binary Data, 1C simply crashes. Look at the listing fragment:

MSWord = Layout.Get(); Try Document = MSWord.Application.Documents(1); Document.Activate(); //Next, we somehow get the data and fill out the Word document //Get the path in the temporary directory to save the file there TimeName = GetTemporaryFileName(".docx"); Document.SaveAs(NameTime); //stone begins here MyDocumentInBinaryData = New BinaryData(NameTime); //well, here this stone is knocked out by 1C :) MSWord.Application.Quit();

Thanks a lot.

Creating folders
C:\Windows\SysWOW64\config\systemprofile\Desktop
C:\Windows\System32\config\systemprofile\Desktop
the problem was solved. Topic closed.

What is the reason? The reason is that the code

MSWord = Layout.Get();

Always calls an instance of a COM object (x32) regardless of what bitness Office is installed. Have you ever wondered why you can’t insert files with the extension docx, xlsx into the ActoveDocument layout?

this can also be checked through the Task Manager, but the fact is that the ActiveDocument layout implicitly calls a COM instance (x32) and therefore all further manipulations must be done taking this feature into account.

1. Either the server and all software must be x32. Then you don’t need to do anything (in the sense of rewriting the code)

2. Either rewrite the code this way

// get the name of the temporary file TimeFile = GetTemporaryFileName("doc"); // this code will definitely call a COM instance of the required bit depth, in our case x64 Word = New COMObject("Word.Application"); Word.Displayalerts = 0; DocumentN = Word.Application.Documents.Add(); DocumentN.SaveAs(TimeFile,0); Word.Quit(); // then everything is as before Layout = Print Management. Printing Form Layout ("Document. Equipment Transfer Act." + Layout Name); MSWord = Layout.Get(); Try Document = MSWord.Application.Documents(1); Document.Activate(); // here we do something, fill in the data // here we will resave our file from COM x62 to COM x64 MSWord.Application.Selection.WholeStory(); MSWord.Application.Selection.Copy(); DocumentN = MSWord.Application.Documents.Open(TimeFile); DocumentH.Activate(); MSWord.Application.Selection.Paste(); DocumentN.SaveAs(TimeFile,0); DocumentN.Close(); MSWord = Undefined; Exception // If an error occurs, error data is printed and the object is closed. Information = ErrorInfo(); GeneralPurposeClientServer.NotifyUser("Error - "+Information.Description+" error code - "+Abb.LP(Information.SourceString)); MSWord.Application.Quit(); EndAttempt;

I think everything is clear here, first we created a COM instance of the required bit depth, created an empty file and saved it to a temporary folder, then we work with COM x32, fill it with data and finally copy the contents of the entire document and save it to a previously prepared file.

Everything is the same, but only for Excel

TimeFile = GetTimeFileName("xls"); Excel = New COMObject("Excel.Application"); Excel.Displayalerts = 0; BookH = Excel.WorkBooks.Add(); SheetN = BookN.WorkSheets(1); BookN.SaveAs(TimeFile, -4143); Excel.Quit(); Layout = PrintManagement.PrintFormLayout("Document.Equipment Invoice."+LayoutName); MSExcel = Layout.Get(); BookN = MSExcel.Application.Workbooks.Open(TimeFile); SheetN = BookN.WorkSheets(1); Trying WBook = MSExcel.Application.Workbooks(1); Sheet = WBook.WorkSheets(1); Sheet.Activate(); // we do something, fill it with data from 1C MSExcel.Application.WorkBooks(1).WorkSheets(1).Cells.Copy(SheetN.Cells); BookN.Save(); BookN.Close(); Exception // If an error occurs, error data is printed and the object is closed. Information = ErrorInfo(); GeneralPurposeClientServer.NotifyUser("Error - "+Information.Description+" error code - "+Abb.LP(Information.SourceString)); MSExcel.Application.Quit(); EndAttempt;

Here you go " first“I decided the stone, on an x64 server with Office x64, everything works exactly like clockwork, without errors and there is no need to create any folders and everything else.

Stone " second". code snippet

TimeFile = GetTimeFileName("xls");

eating is not very good, because it writes to the folder: “c:\Users\ what’s there...”, in general, this folder is always on the black list of all firewalls, antiviruses, etc., etc., at least open the security control center in Word or Excel. Let's look there too

You will have to tinker with this, otherwise there is a possibility of “strange” errors appearing. Therefore I suggest the following:

1. Open the Configurator and add a new Information Register

here we will store our finished Word, Excel files already filled in, of course:

LayoutName - Layout ID

DocumentOffice - Value Storage, here we keep our finished file

2. We add the above code as follows:

MH = Information Registers.TemporaryStorageOffice.CreateRecordManager(); MH.Object = Selection.Link; MZ.LayoutName = LayoutName; MZ.Read(); MH.Object = Selection.Link; MZ.LayoutName = LayoutName; MZ.DocumentOffice = NewValueStorage(NewBinaryData(TimeFile)); MZ.Write(); DeleteFiles(TimeFile);

What we do is we write the finished file to the information register and then delete the temporary file itself, solving the “Word, Excel Security Center” problem. All that remains is to show this finished file to the Client (thin and web clients)

3. Stone " third" - transferring a file to the client, here I’ll just post all the code, some taken from the BSP, some from the “Managed Application” demo configuration, some from the Internet, but in general here is the code (in its entirety)

//////////////////////////////////////////////// //////////////////////////// // SERVICE PROCEDURES AND FUNCTIONS BSP &OnServer Function GetLayout() ObjectLink = DataStructure.Object; LayoutName = DataStructure.LayoutName; Record Key = Information Registers. TemporaryOfficeStorage. CreateRecordKey(New Structure("Object,LayoutName",ObjectLink,LayoutName)); // Address = GetNavigationLink(RecordKey,"OfficeDocument"); Return Address; EndFunction // &OnClient Procedure AfterApplicationStart(ReturnCode, ApplicationName) Export; // End of the Procedure &On the Client Procedure After Receiving Files (Transferred Files, Additional Parameters) Export If NOT Transmitted Files = Undefined Then For each Description of the Transmitted Files Cycle OpAfterAppLaunch = New DescriptionAlerts("AfterLaunchingApplication", ThisObject, Description.Name); StartLaunchApplication(OpAfterStartApplication, Description.Name); EndCycle; endIf; EndProcedure &OnClient Procedure AfterDirectorySelection(SelectedFiles, CommandName) Export If SelectedFiles = Undefined Then Return; endIf; Directory = SelectedFiles; GeneralPurposeServerCall.SaveWorkingDirectory(Directory); If CommandName = "Invoice" Then LayoutName = "Invoice" EndIf; DataStructure.Insert("Directory", Directory); ConnectWaitingHandler("Connectable_SendFileToClient",5,True); End of Procedure &On the Client Procedure Open Files Through Extension (Command Name) OpAfterSelectingDirectory = New DescriptionAlerts("AfterSelectingDirectory", ThisObject, CommandName); Directory = GeneralPurposeCallServer.GetWorkingDirectory(); If Directory = Undefined OR Directory = "" Then Dialog = New FileSelectionDialog(FileSelectionDialogMode.DirectorySelection); Dialog.Header = НStr("ru = "Selecting a directory for temporary storage of files"", "ru"); Dialog.Show(OpAfterSelectingDirectory); Otherwise SelectedFiles = New Array; SelectedFiles.Add(Directory); Perform Alert Processing(OpAfterSelectingDirectory, SelectedFiles); endIf; End of Procedure &On the Client Procedure ProcessConnectingExtensionsWorkingWithFiles(ExtensionConnected,AdditionalParameters) ExportIfExtensionConnectedThenOpenFilesThroughExtension(AdditionalParameters.CommandName); endIf; EndProcedure &OnClient Procedure Connected_PassFileToClient() Address = GetLayout(); If Address<>Undefined Then DisableWaitHandler("Connectable_PassFileToClient"); DocumentNumber = DataStructure.DocumentNumber; Directory = DataStructure.Directory; LayoutName = DataStructure.LayoutName; FilePath = Directory+"\"+LayoutName+"_No"+DocumentNumber+".xls"; Description = New Description of the Transmitted File (Path to File, Address); TransferredFiles = New Array; TransferredFiles.Add(Description); StartReceivingFiles(NewDescriptionAlerts("AfterReceivingFiles", ThisObject), TransferredFiles, "", False); endIf; End of Procedure &On the Server Procedure ExecutePrintServer() ObjectLink = DataStructure.Object; LayoutName = DataStructure.LayoutName; DataStructure.Insert("DocumentNumber", ObjectReference.Number); ObjectArray = New Array; Array of Objects.Add(ObjectRef); Documents.Equipment Invoice.PrintInvoice(Object Array,LayoutName,True); EndProcedure &OnClient Procedure Connectable_ExecutePrint() ExecutePrintServer(); EndProcedure // StandardSubsystems.Print &OnClient Procedure Connectable_ExecutePrintCommand(Command) Link = Elements.List.CurrentData.Link; DataStructure = newStructure; DataStructure.Insert("Object", Link); DataStructure.Insert("LayoutName", "Invoice"); ConnectWaitingHandler("Connectable_Print", 1, True); CommandDescription = PrintManageClient.PrintCommandDescription(Command.Name,FormName); Start Installing FileWorking Extension(); StartConnectingFileWorkingExtension(NewAlertDescription("ProcessConnectingFileWorkingExtension",ThisObject,NewStructure("CommandName",CommandDescription.Identifier))); EndProcedure // End StandardSubsystems.Print

A few clarifications:

1. Firstly, our client works through both Thin and Web modes, so in advance we set the following values ​​in the Configurator properties:

To avoid problems when working with the browser

2. We use wait handlers to avoid problems with call synchronization (this only applies to Web mode)

3. And lastly, connect the Extension for working with Files (remember that in Thin Client mode, this extension is always enabled). And through the code:

we transfer the file to the Client using the NavigationLink mechanism, we receive the following messages in the browser (Thin works by itself):

Well, that seems to be all. Hope this helps someone...

Regarding Word, Excel files inserted as Binary Data? what's the problem?

1. We either have to pull out this Binary Data from the layout and fill it with data from 1C and ATTENTION write it down again in the form of Binary Data (Vodka With Beer or Beer With Vodka)

2. Either we must get the BinaryData layout on the Client side and fill it there, BUT the COM object is supported only by the IE browser and then with dances with ActiveX settings, other browsers have long abandoned the use of ActiveX

I think that each of the "seven" programmers has encountered such an error at least once. It can occur either during “merging configurations” or during “testing and fixing information security.”

But not everyone tried to “fix” the configuration. In such cases, they usually either frantically search for backups, or (a more complex method) resort to the help of the GComp utility, which “according to legend” can cure MD if it is simply “disassembled” and then “assembled” using the functions of the program. Indeed, it is so. But not in all cases... This is exactly the case that I would like to examine in this article.

So, the initial data:

- "broken configuration";

Utility MDDiags

- FarManager and plugin DocFileBrowser to him. Using this plugin, you can go inside the MD and work with its objects.

Since the Configurator refuses to even display this "uncorrectable error", we run MDDiags to identify it or them.

After launching the utility, select the desired configuration, then all the default settings... run, analyze, get the result.

You may have other errors, but I think that you will be able to figure them out once you have a general understanding of how to find the error and how to fix it.

1. Error>(\\Journal)

The utility made it clear that the error was observed for 2 objects "\\ Journal\Journal_Number 212" and "\\Journal\Journal_Number 860". Now let's go toFar and look at the objects there.


We see here many objects and one file "Container.Contents". It stores descriptors of these same objects. After carefully studying the contents of the file, we understand that there are no descriptors for our 2 objects.

Add descriptors as shown in the figure.

Problem solved.

2. Error DOCUMENT.Receipt Invoice (\\TypedText\UserHelp_Number434\Container.Contents)

We go again to MD along the indicated path. Open the file " Container. Contents " and look carefully at its contents.

The strange words Cgntainer, Contentq, Prmgram immediately catch your eye. That's right, these are misspelled identifiers. It’s not difficult to guess how it should be correct (if it’s difficult, go to the next branch, open the same “Container.Contents” file and see how it should be written).

3. ErrorDIRECTORY.Typical Operations(\\Subconto\Subconto_Number5870\WorkBook\Dialog Stream)

Open the file at the specified path and look carefully... All parameters must be enclosed in quotes. One of the parameters has a “space” instead of a “quote” - we correct it (this error can occur when the description of one of the elements of an object (field, button, list of values, etc.) contains a single or double quote, or any of the "special characters").

Let's launch again MDDiags and we see that all previous errors have disappeared, but another error has appeared.

Now it’s time to turn to the GComp utility and check the “legend”...

We launch the utility, select our broken (for now) MD, and the folder where we should put the configuration sorted by objects, then all the checkboxes are by default, the only thing is to check the “delete” checkbox blank templates tables" on the "General parameters" tab, click "Decompile".

Then, without further ado, go to the “compilation” tab, set the source directory to the one in which you just parsed the configuration and indicate the path to the new MD.

The utility will assemble everything safely.

Now we only have to Far Manager replace the corresponding file inside the “broken” MD with the same one from the “just assembled” one (\\Subconto\Subconto_Number5870\WorkBook\Dialog Stream).

We check the configuration again using MDDiags.

Everything seems to be OK. Now we go into the configurator and do “testing and correction of information security” to make sure that there are no more errors.

That's all. Let me take my leave. And may the Force be with you!)

P.S. Special thanks to the developers of the utilities used in the example - they help us all live so much...

Good afternoon!. Last time we looked at how to solve “Error applying transformations. Check the correctness of the paths of the specified transformations”, today I will tell you about another consequence due to it. The topic of the publication will be a situation when you cannot install the 1C platform and you will receive a message: Windows error: function execution error, we solve it in a minute, I’m sure the topic will be useful for many.

What does a function execution error look like?

As I wrote above, I get this problem on a Windows Server 2012 R2 terminal server when I try to install the 1C 8.2 platform. After running the setup.exe file, the installation wizard window appears, and immediately an additional window with the message:

Windows error: function execution error

For which you will receive this notification:

As in most cases with the 1C platform, everything can be solved with a small correction in the configuration files. First, turn on display hidden folders, since the file we need is not visible by default. Next, on the C:\ drive, find the folder ProgramData.

C:\ProgramData\1C\1CEStat\1CEStat.cfg

The 1CEStat.cfg file can be opened using any text editor, right-click on it and select “Open with”, and then a convenient editor.

In the 1CEStat.cfg file, find the parameter, you need to delete it and save the file.

If you look at the logs in the event viewer, you will see events like these.

Event code 1013: Product: 1C:Enterprise 8.2 (8.2.19.130) -- Windows Error: Function execution error.

Event ID 11708: Product: 1C:Enterprise 8.2 (8.2.19.130) -- The installation operation failed.

After we removed the ADMINISTRATIONFUNC=0 parameter, we already received:

Event ID 1033: Windows Installer has installed the product. Product: 1C:Enterprise 8.2 (8.2.19.130). Version: 8.2.19.130. Language: 1049. Manufacturer: 1C. Installation completed with status: 1603.




Top