Меню

2147417851 ошибка на сервере

   KoBapeH

06.12.17 — 15:05

Вопрос к мэтрам некромантии: нужно из питона обратиться к справочнику бухгалтерии. Проблема возникает на стадии открытия выборки ВыбратьЭлементы(), либо SelectItems(). В питон возвращается следующая ошибка: «(-2147417851, ‘Ошибка на сервере.’, None, None)». Такую же ошибку возвращает метод ЗначениеИзСтрокиВнутр() — ValueFromStringInternal(). При этом сам объект справочника создаётся, да и по документам выборка отрабатывает нормально. Из самой 7.7 аналогичный код отрабатывает без проблем.

Насколько я понимаю, это проблема ActiveX, с которым так же работает и Excel. Никто с подобной проблемой не сталкивался, а если сталкивался, то есть ли возможность как-то это исправить? ОС — 7, 64 битная. Платформа 7.7 — 27 релиз. В реестре всё прописано, из-под админа 7.7 запускалась.

   HawkEye

1 — 06.12.17 — 15:19

(0) пробуй SelectItems(1)

   KoBapeH

2 — 06.12.17 — 15:21

Пробовал уже режим ему указывать. И с 0 и с 1 — результат один.

   MadDAD

3 — 06.12.17 — 15:27

(2) А если через EvalExpr()? Чему равен объект справочника?

   MadDAD

4 — 06.12.17 — 15:30

Еще вариант — может с кодировками беда? в 1С нужно строки  передавать в кодировке Win1251

   asady

5 — 06.12.17 — 16:04

   KoBapeH

6 — 06.12.17 — 17:03

(5) Да, проблема та же. Пробовал _FlagAsMethod, ноль реакции.

Если что, вот код


import win32com.client
# import comtypes.client


ole77 = None

try:

    # ole77 = comtypes.client.CreateObject("V77.Application")

    ole77 = win32com.client.Dispatch("V77.Application")
    comConnStr = "/d"E:\Base\BUH NEW\" /n"ad""
    ole77.Initialize(ole77.RMTrade, comConnStr, "NO_SPLASH_SHOW")

except Exception as err:

    print("Не удалось подключиться к базе. Ошибка: " + err.__str__())

if ole77:
    ref_name = 'Справочник.Номенклатура'
    print("Выборка " + ref_name)
    try:
        refer = ole77.CreateObject(ref_name)
        # ole77._FlagAsMethod('SelectItems')

        refer.SelectItems(0)
        while refer.GetItem() == 1:
            string1 = ole77.ValueToStringInternal(refer)
            print("Получено -" + string1)
            new = ole77.ValueFromStringInternal(string1,)
            string2 = new.Наименование
            print("Вернул -" + string2)

    except Exception as err:

        print("Не удалось выбрать справочники. Ошибка: " + err.__str__())

    print("Получение объекта из строки")
    try:
        str_ole = "{"B","0","0","156","0","0","3355"}"
        objectDoc = ole77.ValueFromStringInternal(str_ole)

        print(‘Успех’)

    except Exception as err:

        print("Не удалось получить объект из строки. Ошибка: " + err.__str__())
ole77 = None
   KoBapeH

7 — 06.12.17 — 17:04

(3) Поподробнее можно. Что именно требуется?

   Ёпрст

8 — 06.12.17 — 17:06

(6) соединение то хоть установлено ?

   KoBapeH

9 — 06.12.17 — 17:06

(4) Так ведь режим для выборки не обязательный. Там ничего не передаётся. И если бы была проблема с кодировкой, то выборка по документам бы не работала.

   Ёпрст

10 — 06.12.17 — 17:07

и хз за синтаксис питона, а чего не в двойных кавычках в

CreateObject пихаешь ?

   KoBapeH

11 — 06.12.17 — 17:08

(8) Да, конечно. (10) Да там без разницы.

   Ёпрст

12 — 06.12.17 — 17:08

почему не так, например ?
 ref_name = "Справочник.Номенклатура"
   Ёпрст

13 — 06.12.17 — 17:09

покажи код для документа, который работает у тебя

   Ёпрст

14 — 06.12.17 — 17:10

ну и в базе, есть вообще, Справочник.Номенклатура хоть ?

Может та, Справочник.Товар ?

   Сияющий в темноте

15 — 06.12.17 — 20:56

строки по OLE идут в юникоде,поэтому,работать должно,но непонятно,что питон может делать с переменными,семерка очень капризная

можно попробовать из питона создать VbScript,а уже из него лезть в 1с

  

MadDAD

16 — 07.12.17 — 08:56

(7) Что покажет

refer = ole77.EvalExpr('СоздатьОбъект("Справочник.Номенклатура")')

Problem

User clicks «Reports Run». User chooses selections and runs a report. User receives an error.

Symptom

Standard Error -2147417851
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

Standard Error
Number: -2147467261
Source: interop.Excel
Description: Attempted to read or write protected memory. This
is often an indication that other memory is corrupt.
at Excel._Worksheet.set_EnableCalculation(Boolean RHS)
at Cognos.Controller.Reports.XlLinkLayout.RecalcXL(Int32 lVersion,
Boolean bActiveSheetOnly)

Cause

There are many possible causes for similar errors.

  • See separate IBM Technotes #1574387 & 1665528 for more examples.

This Technote specifically relates to the scenario where the cause is a defect (APAR PM84020) in Controller 10.1.1 IF2 (10.1.1308) and some later versions.

Environment

Affects Controller 10.1.1308 -> 10.1.1703 (inclusive) and 10.1.2155 to 10.1.2163 (inclusive).

However, this does *not* occur in all environments. Specifically:

  • BAD (problem occurs): Client device has Office 2010 installed on Windows XP (or Windows 2003)
  • GOOD (report works OK): Client device has Office 2010 installed on Windows 7 (or Windows 2008)

Resolving The Problem

Fix:

The fix depends on what version of Controller you are currently using:

(1) Controller versions between 10.1.1308 and 10.1.1703 (inclusive)

  • Upgrade to Controller 10.1.1707.

(2) Controller 10.1.2155 or later.

  • Upgrade to Controller 10.1.2659 or later.

Workaround:

There are several possible workarounds:

  • Method #1 (Recommended) — Upgrade client device to either Windows 7 (laptops / desktop PCs) or Windows 2008 (Citrix/Terminal Servers) as appropriate.

This should ensure that users never see the error, and therefore is (often) the easiest workaround.

  • Method #2 — Exit Excel and re-launch Excel when receive the error.

Typically the user will only see the error after refreshing reports several times (for example 3 or 4 times). If the end user closes Excel (after receiving the error) and then re-launches Excel (and re-runs the report) then they will not see the error.

  • Method #3 — Simplify the spreadsheet and/or enable Optimise2

By reducing the complexity of the spreadsheet (or enabling Optimise2 — see Technote 1347048) this will have the effect of reducing the strain on the system (and therefore reducing the frequency of when the error message is seen).

In one real-life customer example, the customer had one ‘bad’ report where they had formatted colour (on columns and rows) for endless amounts of cells.

  • In fact these cells were hidden (so it was necessary to unhide rows/columns to see them).
  • Once the colour was removed (i.e. no fill) the report ran OK.
  • In other words, the solution was to remember that customers should only format the necessary/required cells (not endless amounts of unused cells) because Microsoft Excel (and Controller) will consider these when running the report (causing the complexity of the task to increase).

Related Information

[{«Product»:{«code»:»SS9S6B»,»label»:»IBM Cognos Controller»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Controller»,»Platform»:[{«code»:»PF033″,»label»:»Windows»}],»Version»:»10.1.1″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

  • Remove From My Forums
  • Question

  • I am trying to importing an excel (2007) spreadsheet as a new list in MOSS 2007
    and I keep getting the following unhelpful and obsecure message with Excel just hanging :

    ‘An Unexpected Error has occurred (-2147417851) — Looking up this error revealed that -2147417851 indicates ‘The server threw an exception’

    On a previous installation I have dealt with the Method ‘Post of object ‘IOWSPostdata’ failed 
    by making the change to EXPTOOWS.XLA. It’s happening with any spreadsheet I try…..

    lVer = 2 

    However, this is quite different.

    Has anyone dealt with issue. If not will it be a case of throttling the logs then recreating to see if I can get more details.

Answers

  • I have now fixed the issue whereby I couldn’t logon on to SharedServices1 Admin (http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/37045920-2bd3-4804-b71f-a55d3d36b97f ).

    This pull method is still giving me an issue.  To recap:

       1. I click on «Site Actions» and select «Create»
       2. Under «Custom Lists», I select «Import Spreadsheet» (.xlsx
       3. I type the Name, Description and Select a MS Excel 2007 spreadsheet (
       4. As soon as I click «Import», I receive an error: «An unexpected error has occurred. (-2147417851)»

    The import site has been added as a trusted site in IE8 and  lVer =2  in the Sub Initialize(List, Title, URL, QuickLaunch) in EXPTOOWS.XLA So other than trying to attach a debugger to the EXPTOOWS.XLA I am at a bit of a loss as how this issue can be solved The Push method when publishing to the main site (server:port) did work.  However you can’t dynamically select a range of rows during the import so this is not really my preferred option.

    • Edited by

      Tuesday, July 21, 2009 8:18 AM

    • Marked as answer by
      Xue-Mei Chang-MSFTModerator
      Friday, July 24, 2009 6:46 AM

  • Remove From My Forums
  • Question

  • I am trying to importing an excel (2007) spreadsheet as a new list in MOSS 2007
    and I keep getting the following unhelpful and obsecure message with Excel just hanging :

    ‘An Unexpected Error has occurred (-2147417851) — Looking up this error revealed that -2147417851 indicates ‘The server threw an exception’

    On a previous installation I have dealt with the Method ‘Post of object ‘IOWSPostdata’ failed 
    by making the change to EXPTOOWS.XLA. It’s happening with any spreadsheet I try…..

    lVer = 2 

    However, this is quite different.

    Has anyone dealt with issue. If not will it be a case of throttling the logs then recreating to see if I can get more details.

Answers

  • I have now fixed the issue whereby I couldn’t logon on to SharedServices1 Admin (http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/37045920-2bd3-4804-b71f-a55d3d36b97f ).

    This pull method is still giving me an issue.  To recap:

       1. I click on «Site Actions» and select «Create»
       2. Under «Custom Lists», I select «Import Spreadsheet» (.xlsx
       3. I type the Name, Description and Select a MS Excel 2007 spreadsheet (
       4. As soon as I click «Import», I receive an error: «An unexpected error has occurred. (-2147417851)»

    The import site has been added as a trusted site in IE8 and  lVer =2  in the Sub Initialize(List, Title, URL, QuickLaunch) in EXPTOOWS.XLA So other than trying to attach a debugger to the EXPTOOWS.XLA I am at a bit of a loss as how this issue can be solved The Push method when publishing to the main site (server:port) did work.  However you can’t dynamically select a range of rows during the import so this is not really my preferred option.

    • Edited by

      Tuesday, July 21, 2009 8:18 AM

    • Marked as answer by
      Xue-Mei Chang-MSFTModerator
      Friday, July 24, 2009 6:46 AM

Добрый день!  
Прошу помощи.  

  При формировании письма в Lotus из Excel периодически выскакивает ошибка:  
Run-time error ‘-2147417851 (80010105)’: Automation error  
VBA ругается на строку:  
Set uiDoc = uiWorkspace.EDITDOCUMENT(True, MailDoc)  

  В чем может быть проблема?  

  Код макроса прилагаю.  
==========================  

  Sub Макрос_ОтправкаПисьма()  

  Dim Maildb As Object ‘The mail database  
Dim UserName As String ‘The current users notes name  
Dim MailDbName As String ‘The current users notes mail database name  
Dim MailDoc As Object ‘The mail document itself  
Dim AttachME As Object ‘The attachment richtextfile object  
Dim Session As Object ‘The notes session  
Dim EmbedObj As Object ‘The embedded object (Attachment)  
Dim Subject As String ‘The subject string  
Dim Attachment As String ‘The path to the attachemnt string  
Dim Recipient As String ‘The Recipient string (or you could use the list)  
Dim Recip(10) As Variant ‘The Recipient list  
Dim BodyText As String ‘The body text  
Dim SaveIt As Boolean ‘Save to sent mail  
Dim WasOpen As Integer ‘Checking to see if the Mail DB was already  
Dim uiDoc As Object  
Dim uiWorkspace As Object  
Dim docProfile As Variant  
Dim strProfileEnableSignature As Variant  
Dim CopyTo As String  
Dim BlindCopyTo As String  

    Application.ScreenUpdating = False  
Application.DisplayAlerts = False  

  Subject = ТемаПисьма  
Recipient = Email_Кому  
CopyTo = Email_Копия  
BlindCopyTo = Email_СкрытаяКопия  
SaveIt = True  

  Set Session = CreateObject(«Notes.NotesSession»)  
Set uiWorkspace = CreateObject(«Notes.NotesUIWorkspace»)  

  UserName = Session.UserName  
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) — InStr(1, UserName, » «))) & «.nsf»  
Set Maildb = Session.GETDATABASE(«», MailDbName)  

  If Maildb.IsOpen = True Then  
WasOpen = 1 ‘Already open for mail  
Else  
WasOpen = 0  
Maildb.OPENMAIL ‘This will prompt you for password  
End If  

  Set MailDoc = Maildb.CREATEDOCUMENT  
MailDoc.Form = «Memo»  
MailDoc.sendto = Recipient ‘Or use Racip(10) for multiple  
MailDoc.CopyTo = CopyTo  
MailDoc.BlindCopyTo = BlindCopyTo  
MailDoc.Subject = Subject  

  MailDoc.Body = ТекстПисьма  

  ‘MailDoc.SAVEMESSAGEONDRAFTS = SaveIt  
Set AttachME = MailDoc.CREATERICHTEXTITEM(«Attachment»)  
Set EmbedObj = AttachME.EMBEDOBJECT(1454, «», ВложениеПисьма)  

  ‘MailDoc.PostedDate = Now() ‘Gets the mail to appear in the sent items folder  
‘Set uiDoc = uiWorkspace.EDITDOCUMENT(True, MailDoc)  
Set docProfile = Maildb.GETPROFILEDOCUMENT(«CalendarProfile»)  
strProfileEnableSignature = docProfile.GETITEMVALUE(«EnableSignature»)(0)  
If strProfileEnableSignature = «1» Then  
docProfile.EnableSignature = «»  
Call docProfile.Save(True, False)  
End If  

  Set uiDoc = uiWorkspace.EDITDOCUMENT(True, MailDoc)  

  If strProfileEnableSignature = «1» Then  
docProfile.EnableSignature = «1»  
Call docProfile.Save(True, False)  
End If  

  ‘MailDoc.SEND 0, Recipient // if you want to send  
Set Maildb = Nothing  
Set MailDoc = Nothing  
Set AttachME = Nothing  
Set EmbedObj = Nothing  
Set uiDoc = Nothing  
If WasOpen = 1 Then  
Set Session = Nothing  
ElseIf WasOpen = 0 Then  
Set Session = Nothing  
End If  

  Dim Msg, Style, Title  
‘Msg = «E-mail has been sent to » & Recipient & Chr(13) & Chr(10) & Chr(13) & Chr(10) & «Press OK to continue.»  
Style = vbOKOnly + vbInformation  
Title = «Open Issues List»  
‘Response = MsgBox(Msg, Style, Title, Help, Ctxt)  

  Application.DisplayAlerts = True  
Application.ScreenUpdating = True  

      End Sub

  • Remove From My Forums
  • Question

  • I have an MS Access file that opens a word template, populates it with data and saves it to a local share. The following code produces the above error:

    Dim WordObj As Word.Application
        
      Set WordObj = CreateObject("Word.Application")
      WordObj.Visible = True
      WordObj.Activate
      WordObj.ShowMe
      WordObj.WindowState = wdWindowStateMaximize
      WordObj.Documents.Add(GetTemplatePath(strDocPath))
    
    WordObj.ActiveDocument.SaveAs FileName:=FullDocName, FileFormat:=12 //this line produces the above error

    I have tried many combinations of early / late binding with the word application object and always get the same result. The word document will open and the functions which insert text will run successfully, but the document will not be saved and if any further
    editing is attempted Word will crash.

    I suspect that code isnt the problem; I have another identical workstation that is able to open and save the output document. What external factors could cause this?

Answers

  • What version of office do you have installed on your PC?

    You can specify the version of excel you are creating the object.

    From :

    Set WordObj = CreateObject(«Word.Application»)

    to :

    Set WordObj = CreateObject(«Word.Application.12»)

    You also may want to try using the following

    WordObj.ActiveDocument.SaveAs FileName:=FullDocName, FileFormat:=acFileFormatAccess2007

    Check the menu in access vba Tools — References Microsoft Word XX.X object Library.  You may have to browse for a newer version of the object library.  what sometimes hapPens if the macro was developed on a PC with 2003 the reference may be
    pointing to the object library 11.0 while you need 12.0.

    Make sure the version  of the object library is compatible with Word 2007.  Version 12 is office 2007.  The create object will automatically use the defualt version of office that is installed on your PC.  If you have  office 2010
    installed you may need to specify a differnt version.

    Errors like -2147417851 (80010105) are usually caused by not having the priveledge to open the file.  Make sure you can open the file by double clicking on the file and opening.  I would aslo suspect you would get the error if your configuration
    (like the reference) doesn’t support office 2007.


    jdweng

    • Marked as answer by

      Friday, February 25, 2011 9:50 AM

  • Wrong approach. You mix the application object with document object. Try this:

      Dim appWord As New Word.Application
      Dim objWord As Word.Document

      Set objWord = appWord.Documents.Add(GetTemplatePath(strDocPath))

      appWord.visible = True
      appWord.Activate
      appWord.ShowMe
      appWord.WindowState = wdWindowStateMaximize

      appWord.ActiveDocument.SaveAs FileName:=FullDocName, FileFormat:=12

    Greg

    • Marked as answer by
      Bruce Song
      Friday, February 25, 2011 9:50 AM

  • Hi Richard,

    it’s interesting because this cide works fine for me with Office 2007:

     Set wordobj = CreateObject("Word.Application")
     wordobj.Visible = True
     wordobj.Activate
     wordobj.ShowMe
     wordobj.WindowState = wdWindowStateMaximize
     wordobj.Documents.Add "********Desktoptest.docx"
     wordobj.ActiveDocument.SaveAs FileName:="********Desktoptest1", FileFormat:=12
     wordobj.Quit
     Set wordobj = Nothing
    

    But I’ve been facinf the situation when Excel automation hadn’t worked until setting the whole object «stairway».

    Suggestions:

    — Are you sure that exactly the last line causes an error?

    — Does FullDocName have an extension part?

    — Do you have more than one version of Office installed on this workstation?


    Andrey V Artemyev | Saint-Petersburg, Russia

    • Marked as answer by
      Bruce Song
      Friday, February 25, 2011 9:50 AM

  • Remove From My Forums
  • Вопрос

  • I am trying to importing an excel (2007) spreadsheet as a new list in MOSS 2007
    and I keep getting the following unhelpful and obsecure message with Excel just hanging :

    ‘An Unexpected Error has occurred (-2147417851) — Looking up this error revealed that -2147417851 indicates ‘The server threw an exception’

    On a previous installation I have dealt with the Method ‘Post of object ‘IOWSPostdata’ failed 
    by making the change to EXPTOOWS.XLA. It’s happening with any spreadsheet I try…..

    lVer = 2 

    However, this is quite different.

    Has anyone dealt with issue. If not will it be a case of throttling the logs then recreating to see if I can get more details.

Ответы

  • I have now fixed the issue whereby I couldn’t logon on to SharedServices1 Admin (http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/37045920-2bd3-4804-b71f-a55d3d36b97f ).

    This pull method is still giving me an issue.  To recap:

       1. I click on «Site Actions» and select «Create»
       2. Under «Custom Lists», I select «Import Spreadsheet» (.xlsx
       3. I type the Name, Description and Select a MS Excel 2007 spreadsheet (
       4. As soon as I click «Import», I receive an error: «An unexpected error has occurred. (-2147417851)»

    The import site has been added as a trusted site in IE8 and  lVer =2  in the Sub Initialize(List, Title, URL, QuickLaunch) in EXPTOOWS.XLA So other than trying to attach a debugger to the EXPTOOWS.XLA I am at a bit of a loss as how this issue can be solved The Push method when publishing to the main site (server:port) did work.  However you can’t dynamically select a range of rows during the import so this is not really my preferred option.

    • Изменено

      21 июля 2009 г. 8:18

    • Помечено в качестве ответа
      Xue-Mei Chang-MSFTModerator
      24 июля 2009 г. 6:46

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • 2146893792 ошибка при вставке смарт ключа
  • 2146434962 код ошибки газпромбанк