AnsweredAssumed Answered

VBA Excel Problems

Question asked by Peter Zeyher on Jan 24, 2008
Latest reply on Feb 5, 2008 by Mahir Abrahim
Hi,

I have written a macro that copys a BOM content from a drawing into an Excel BOM. It all works fine except for two problems:

After all copying is done is use a dialog to ask the user to either view the Excel BOM or not.
To view i just use

appExcel.Visible = True

since the makro runs excel "invisible".

If the user chooses to not view the BOM I would like excel to quit. I am trying to achieve this with

appExcel.Application.Quit

but with no success. An invisible instance of excel stays open.

How to I properly quit excel?

The second problem is that the user chooses the Excel BOM from a open file dialog:

fileToOpen = appExcel.GetOpenFilename("BOM_Template (*.xls), *.xls", , "Wählen Sie die Stücklistendatei aus in die gespeichert werden soll")

If the user is not fast enough with locating a excel BOM the system seems to think that there is something wrong excel and a error message pops up letting the user choose to repeat or locate a different application (its in german and i don't know the proper translation).

Is there any way to give the user more time to locate the correct excel BOM?

Thanks already

Peter

Outcomes