Balagurunathan Marimuthu
Balagurunathan Marimuthu

Reputation: 2978

How to resolve issue with Office Interop Assemblies on VB6 exe installation?

I have developed one trading application using VB6. In that, I have used Excel application object as below (Excel.Application).

Set xl = New Excel.Application
Set xlwbook = xl.Workbooks.Add
Dim xlsheet As Worksheet
Set xlsheet = xlwbook.Sheets.Item(1)

And, I have created the installer for that VB6's exe using Advanced Installer with prerequisites as Office 2010 Primary Interop Assemblies points to - o2010pia.msi (To enable the option to access Excel.Application).

I am unable to run installed application even installed the Office 2010 Primary Interop Assemblies. It throws Object Required error.

Note: I have googled regarding this, many of them suggested their solution for C# and/or VB .Net environment. I want it for VB6 environment.

Please help me to resolve this? Thanks in advance.

Upvotes: 1

Views: 440

Answers (1)

OldBoyCoder
OldBoyCoder

Reputation: 876

I'll summarize the comment thread as an answer. The OP has written a VB6 application that uses COM to create Excel spreadsheets. He was including the Office interop assemblies as part of his install but his code to create spreadsheets wasn't working. The reason for this is that Office was not installed on the end user computer.

The Office Interop Assemblies only give .NET applications an interface through which they can talk to the COM interface of an installed MS Office application, they don't provide Office functionality. In the OP's case he wouldn't need them as VB6 can talk directly to the COM interface of MS Office.

The OP either needs to install Office on his end user computers or generate his spreadsheets in a different way, maybe as a CSV.

Upvotes: 1

Related Questions