View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter Karlström Peter Karlström is offline
external usenet poster
 
Posts: 13
Default WorkbookOpen in COMAddin for CSV-files

Hi Joel

There is a COM Addin DLL loaded together with Excel when Excel starts,
dispite in what way it starts.
And It also loads and runs even if a workbook is ReadOnly. This is not the
issue.

So, the Addin is always loaded and are running throughout the whole process.

When Excel is pre-started, the CSV file is loaded and the COM Addins event
<ExcelObject.WorkbookOpen is triggered.
This event (<ExcelObject.WorkbookOpen) is not triggered when the same file
is opened in the exact same way, if Excel is not previously started.

This is the issue.

This COM Addin is developed in VB6, but we have tested a VB.NET version, and
gets the same result. This is more Excel specific then development
environmental.

Hope this straitens the questionmarks...

Regards
--
Peter Karlström
Midrange AB
Sweden


"Joel" wrote:

The com addin is treated the same way as a macro would be in terms of
security. If the workbook is opened in READ-ONLY mode then neither the addin
or the macros will run. The web server is probably using some firewall
software to disable the addin from running. I'm trying to determine the
methods you are using to open the workbook to see if there is a way to get
the worbook to open in a non READ ONLY MODE.


A CSV file is just a text file and contains no addins. For the Addin to run
automatically it must either be in a personal.xls file on you PC or there is
an On Open event you have created on you PC. the addin is not in the CSV
file itself. I don't know all the details so I can't give a good answer.

"Peter Karlström" wrote:

Hi Joel

There are no macros involved. COM Addin is as DLL-addin.
Th COM Addin is activated when the CSV-file opens, but the builtin Excel
WorkbookOpen event is not triggered.
It IS triggered with the exact same file if Excel is already started.

Best Regards
--
Peter Karlström
Midrange AB
Sweden


"Joel" wrote:

the workbook is being open in a mdoe where macros are not enabled. this is
to prevent viruses from spreading using macros inside of workbooks. I'm not
sure if the webserver is causing the problem or the method you are using to
open the workbook. Can you give details on how the workbook is being opened?

"Peter Karlström" wrote:

Hi

We have an Excel COM-Addin created wich trapps the WorkbookOpen event.
This works fine for all Excel sheets.
But we have problems in our CSV-file import routine, and it seems that the
above event isn't triggered for the CSV-file if Excel is not started
beforehand.
The CSV-file is opened from a web application (IE).
If the file is saved on disk before opened it works, but not if you choose
Open in the browser dialog.

Does anybody have a clue?

Thanks in advance
--
Peter Karlström
Midrange AB
Sweden