Add-in opens and then nothing (no error message)

C

CLarkou

I developed 2 add-ins in Office 97, one for excel and one for power
point.

Excel add-in references the following files:
EXCEL8.OLB
DAO350.DLL
STDOLE2.TLB
FM20.DLL
MSO97.DLL
COMDLG32.OCX
MSCOMCTL.OCX
MSFLXGRD.OCX

Power Point add-in references the following files:
MSPPT8.OLB
DAO350.DLL
STDOLE2.TLB
FM20.DLL
MSO97.DLL
GRAPH8.OLB
EXCEL8.OLB
COMDLG32.OCX
MSCOMCTL.OCX
MSFLXGRD.OCX

Excel add-in works on all computers without any problem. Power Point
add-in on some computers
opens, executes some statements and stops on the line before calling
the procedure for creating a new
workspace for opening MSAccess databases (no error message, nothing).
The solution I found until now, is the following:

1. Open Power Point.
2. Create a new Presentation.
3. Create a new Slide.
4. Select TOOLS\MACRO\VISUAL BASIC EDITOR.
5. Select TOOLS\REFERENCES.
6. Select the files program needs
7. Place reference files in the same order as in my add-in.
8. Click OK button.
9. Select DEBUG\COMPILE VBAPROJECT.
10. Close Power Point.
11. Try to open add-in.

After these steps everything works ok. Strange but something happens
with references. No files are missing
since Excel add-in runs without any problem. Their references
difference are 2 files (MSPPT8.OLB & GRAPH8.OLB).

Does anyone know why this happens, and any alternative solutions ?
 
S

Steve Rindsberg, PPTMVP

Just a wild guess: two libraries might have the same named object. I
suspect VBA grabs the first one it finds on the list of references. By
changing the order, you forced it to use the one you were after.

For example:

Dim dada As Chart ' luck of the draw, take whatever Chart object
it fnds
Dim yada As Graph.Chart ' bull by the horns, DEMAND a Graph Chart object


--

Steve Rindsberg PPT MVP
PPTLive ( http://www.pptlive.com ) Featured Speaker
PPTools: http://www.pptools.com
PPT FAQ: http://www.pptfaq.com
 
C

CLarkou

Steve, I checked my variables declaration and I have "Excel.chart",
Worksheet, OLEFormat. Add-in opens a logon form for confirming user's
name and password with the Access SYSTEM.MDW. When these are logon
closes I will open the other forms for creating charts.

The following code is from SAVE button of logon form.

Private Sub btn_save_Click()

On Error GoTo error_handler:

Dim var_user_password As String

If (Len(Trim(fld_user_name)) = 0) Or IsNull(fld_user_name) Then
fld_user_name.SetFocus
Exit Sub
End If

read_INI_info 'Use GetPrivateProfileString for reading info from
..INI file

var_user_name = fld_user_name
var_user_password = fld_password

MsgBox "open workspace"

open_workspace var_user_password

..........................................................................

Public Sub open_workspace(vnp_user_password As String)

On Error GoTo error_handler:

Dim db_users As Database

var_error_found = False

MsgBox "open wk - engine"

DBEngine.SystemDB = var_SYSTEM_MDW_path

On Error Resume Next

MsgBox "open wk - creating"

Set db_workspace = CreateWorkspace("PP_Wrksp", var_user_name,
vnp_user_password, dbUseJet)

-------------------------------------------------------------------------------

ONLY message "open workspace" from btn_save is displayed before
calling "Open_workspace". No messages are displayed after this.

This situation is very strange. It happened on another machin now with
WinNT & Office 97. Under administrator, no problem, under PowerUser,
problem appears.
 
S

Steve Rindsberg, PPTMVP

No error message, nothing.

That's not what I was asking.

I wanted to know whether your error handler is SUPPOSED to display messages.
If not, I'd rewrite it so it does.
 
C

CLarkou

Sorry, for misunderstanding. Yes, in each procedure I have error
handler for displaying the errors, but no error message is raised.
 
S

Steve Rindsberg, PPTMVP

Have you set a break point then and stepped through the code while it runs?

By the way, would you do me a favor and leave the pertinent bits quoted in
your replies?
It makes it easier to follow the thread; it seems to be the done thing in
this particular group; at least nobody will flog you for it.

--

Steve Rindsberg PPT MVP
PPTLive ( http://www.pptlive.com ) Featured Speaker
PPTools: http://www.pptools.com
PPT FAQ: http://www.pptfaq.com
 
C

CLarkou

No, I haven't because client is in a different country. I tried to put
as many msgboxes and send testing add-ins to find out the stop point.
The last message displayed is the one before calling the procedure
GET_USER. No messages are displayed from GET_USER procedure.

On Error GoTo error_handler:

MsgBox "open wk - before user" 'MESSAGE DISPLAYED

get_user

---------------------

Public Sub get_user()

On Error GoTo error_handler:

MsgBox "USE - getting us 0" 'MESSAGE NOT DISPLAYED

Dim db_users As Database

MsgBox "USE - getting us 1" 'MESSAGE NOT DISPLAYED

---------------------------------

Most probably the problem is created by AS DATABASE declaration
variable. The strange thing is that Excel has the same code as Power
Point up to this point of problem and working just fine.
 
S

Steve Rindsberg, PPTMVP

See below:

CLarkou said:
No, I haven't because client is in a different country. I tried to put
as many msgboxes and send testing add-ins to find out the stop point.
The last message displayed is the one before calling the procedure
GET_USER. No messages are displayed from GET_USER procedure.

On Error GoTo error_handler:

MsgBox "open wk - before user" 'MESSAGE DISPLAYED

get_user

---------------------

Public Sub get_user()

On Error GoTo error_handler:

MsgBox "USE - getting us 0" 'MESSAGE NOT DISPLAYED

Dim db_users As Database

MsgBox "USE - getting us 1" 'MESSAGE NOT DISPLAYED

---------------------------------

Most probably the problem is created by AS DATABASE declaration
variable. The strange thing is that Excel has the same code as Power
Point up to this point of problem and working just fine.

PowerPoint won't compile AS DATABASE on its own. It might if your project
includes a reference to another object library (Excel, Access?) that
provides this data type.

Remind me: is this code part of a PPT addin or something else? COM addin,
maybe?
If COM, it wouldn't display compiler errors on another system the way a PPT
addin would.

I'd look at that DATABASE type more closely. What app is supposed to supply
it? Is it present on the remote system? Version differences between what
you have and what they have?
 
C

CLarkou

This code is part of a PPT add-in (Office 97), which has a reference
to DAO350.DLL for accessing MSAccess databases data.

The MSAccess database (MDE file) is a program on it own (referencing
DAO350.DLL), sending charts to Excel. Is working without any problem
on the machine. Now I developed a PPT add-in and an Excel add-in which
both of them read data from the MSAccess databases in order user to
create his own presentations. Both of the add-ins as soon as they open
are trying to validate user's password from system.mdw (securing the
MSAccess databases).
The password is validated. I am trying to open the users database for
reading the user no (I am keeping the user names also in an MDB file
along with user numbers). This is the part where problem appears.
Excel add-in has the same code for the logon screen and references
DAO, but everything is ok.
Only PPT add-in has a problem. If DAO350.DLL had any problems, i.e.
not being registered correctly, having missing DLLs or version
differences shouldn't excel add-in and MDE have a problem also ?

On other machines that had the same problem and was solved, I was
creating a new blank presentation, adding the same references as my
add-in and debugging it. After these steps my add-in was working fine.
Even this is strange.
 
S

Steve Rindsberg, PPTMVP

Your logic sounds good to me, but I'm afraid I've no experience with Access
or DAO; have you posted to one of the Access groups as well? That might be
a good idea. Considering the nature of the problem, nobody should get
excited about a few crossposts - it only makes sense in a cross-version app
like yours.

--

Steve Rindsberg PPT MVP
PPTLive ( http://www.pptlive.com ) Featured Speaker
PPTools: http://www.pptools.com
PPT FAQ: http://www.pptfaq.com
 
C

CLarkou

Thanks a lot Steve. I will check it.

Steve Rindsberg said:
Your logic sounds good to me, but I'm afraid I've no experience with Access
or DAO; have you posted to one of the Access groups as well? That might be
a good idea. Considering the nature of the problem, nobody should get
excited about a few crossposts - it only makes sense in a cross-version app
like yours.

--

Steve Rindsberg PPT MVP
PPTLive ( http://www.pptlive.com ) Featured Speaker
PPTools: http://www.pptools.com
PPT FAQ: http://www.pptfaq.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top