Using Microsoft (Office) 365 tools in Visual Basic 6.0

纵饮孤独 提交于 2021-02-05 06:01:09

问题


I'm developing an application written in Visual Basic 6.0 that supports exporting listViews to Microsoft Excel documents. Everything works perfectly fine if a user has an older version of Microsoft Office installed.

Now I want to add support for users who only have Microsoft/Office 365 on their systems. I've googled my way into depression in the past couple of days because I don't know much (or anything really) about dll/ocx files or registries. I'm not even sure if something like this can even be done because VB6 is really old, as noted here.

I've tried using this approach, but it didn't help me.

Right now, I'm getting a 429 runtime error

ActiveX Component can't create object

on line

Set objExcel = CreateObject("Excel.Application")

I only have Microsoft 365 trial version (no older ones) installed on the system and have these two things checked in my references:

I've also tried searching for Excel.Application in the registry, as suggested here, but I can't find the path to the corresponding ActiveX file (which probably means it is not registered if I understand this correctly).

What can I do? Any help would be greatly appreciated.


回答1:


Never mind, I found the answer myself. The problem was that I had older Office versions installed when I installed new 365 package and for some odd reason the .dll files for 365 version weren't registered. When I deleted those older versions all the working .dll files were gone with them.

I did a repair of the 365 installation and it's working perfectly now.



来源:https://stackoverflow.com/questions/62830010/using-microsoft-office-365-tools-in-visual-basic-6-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!