none
Office documents generation in VB.Net program causes Microsoft Office illegal version RRS feed

  • Question

  • I developed a WPF program in VB.Net. In the program I use OpenXML SDK 2.0 to generate a MS Word document and use Interop.Excel 12.0 to generate MS Excel workbook. In one client machine with Microsoft Office Professional 2013 installed, after user run my program and generate Word or Excel document, the Word or Excel documents are generated successfully, but "You are using an illegal version of Microsoft Office" error shows up when user try to open any MS Office document, even they are not generated from my program. User can repair MS Office through control panel to make MS Office work well, but it will happen again after using my program.

    I struggled this issue for a few days but could not get any progress how Office documents generation can damage MS Office license. By the way this issue only happened on this client machine not others.

    Any help will be much appreciated.

    Thanks,

    Andrew

    Monday, August 24, 2015 7:52 PM

All replies

  • I developed a WPF program in VB.Net. In the program I use OpenXML SDK 2.0 to generate a MS Word document and use Interop.Excel 12.0 to generate MS Excel workbook. In one client machine with Microsoft Office Professional 2013 installed, after user run my program and generate Word or Excel document, the Word or Excel documents are generated successfully, but "You are using an illegal version of Microsoft Office" error shows up when user try to open any MS Office document, even they are not generated from my program. User can repair MS Office through control panel to make MS Office work well, but it will happen again after using my program.

    I struggled this issue for a few days but could not get any progress how Office documents generation can damage MS Office license. By the way this issue only happened on this client machine not others.

    Any help will be much appreciated.

    Thanks,

    Andrew

     
    • Merged by Xavier Xie-MSFT Tuesday, August 25, 2015 3:10 AM office dev related
    Monday, August 24, 2015 4:39 PM
  • I wonder whether it's the install process rather than running your app is the problem.

    Could the office install have been differenton your problem machine?

    Check what you distribute.

    I would uninstall your app, uninstall office, install office, install app.

    See whether office works.

    Run app and export.

    See whether office works.


    Monday, August 24, 2015 5:10 PM
  • Thanks for your reply Andy.

    I bought the client's MS Office Professional 2013 from Microsoft Online for single user. The user has been used MS Office for over a couple of months without any issues before I install my app. Also after repair MS Office, it has no issues until I run export function through my program. It seems to be pretty clear my program damage the license of Office.

    By the way what do you mean "Check what you distribute"?

    Thanks,

    Monday, August 24, 2015 5:42 PM
  • Distribute as in dll etc you install.

    .

    As you say though, as weird as it seems , running it is the thing causes the problem.

    I've used both interop and open xml in apps.

    Never both in the same one though.


    Monday, August 24, 2015 6:07 PM
  • We keep OpenXML there since we do not want to invest programming time to change codes. Another weird thing is we have around 20 people to use our program but only one client machine has this issue. Some of users have the same machine as the problem machine with Win 7 and Office 2013.

    Monday, August 24, 2015 6:32 PM
  • Well actually it's interop I would prefer to avoid. Interop is rather unreliable - not disable office unreliable - but it's prone to just not working on the occasional machine.

    By openxml 2 do you literally mean 2?

    AFAIK it's been replaced with 2.5

    https://msdn.microsoft.com/en-us/library/office/bb448854.aspx?f=255&MSPPError=-2147217396


    Monday, August 24, 2015 7:16 PM
  • Thanks again. Yes we are still using OpenXml 2.0. Do you think I can get some help from Office forum? I am thinking to move this thread to Office forum.
    Monday, August 24, 2015 7:24 PM
  • Maybe repeat the question there rather than move the thread.

    You still have a chance someone has seen the problem.


    Monday, August 24, 2015 7:46 PM
  • Hi Andrew,

    Based on my understanding, the Open XML is .Net libary for manipulate the Office document even the Office is not installed. And Office PIAs is used to automate the Office application. Both of them wouldn't corrupt the Office product.

    >>By the way this issue only happened on this client machine not others<<

    Is the version of Office on the issue machine is same as others? Since the issue only on the clinet machine, I suggest that you check whether they used other software may corrupt the Office.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 25, 2015 2:27 AM
    Moderator
  • Hi Andrew

    One thing you should try, in order to isolate whether the problem is with the documents generated, is to give this user documents created by your app on a different machine that open correctly on that machine. If the error does not occur, then it's probably not the documents, but something else.

    If it's not the documents, then I'd create a small WPF app that doesn't really do too much, have the user install it, run it and see if that raises the issue. (Note: if your WPF app communicates with Word at the interop level, even if it's to open the document you generate, use the Interop in this test app and provide to "modes": one test run with and the other without the Interop in order to see if it has something to do with the Interop.)

    The other thing to look at would be whether the user profile might be damaged: Create a new user profile (which should "inherit" the Office installation) and see whether the same behavior occurs.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, August 25, 2015 1:55 PM
    Moderator
  • Thank you Fei.

    Previously the client has Office Home and Business 2013 OEM from Dell, which is the same version as other clients. After we encounter the error, I bought a new Office 2013 Professional from Microsoft Online and try to avoid this error. Unfortunately the error is still there.

     
    Tuesday, August 25, 2015 7:39 PM
  • Thank you Cindy,

    It is a good idea to try documents created on other machines. At least we know the error is happened on generation process or open process after trying. The client is sale person and travel abroad, I will test it as soon as I get computer. Creating a new user profile may be a good try too.

    Tuesday, August 25, 2015 7:49 PM