Link to home
Start Free TrialLog in
Avatar of c4mar
c4mar

asked on

run time error "ISAM" by open with excel

hi,
I have wrote a small application that work with Access database and excel worksheet(I using Excel 8.0 as reference). It runs perfect ok in my workstation. However, after I setup up the application setup wizard. It reports "found excel 8.0 as reference. but no dependency information was avaible to locate the depednent OLE automation server. require to add manual in step 4"

I have add excel.exe as the OLE in the stag4 so it could make it as my reference. However, after I install the application in other workstation, it will crash and report a error with message "Run time error 3170. can't find installable ISAM". I believe I must make some small mistake when I setup the application. Could anyone tell me where have I down wrong???? and where to fix it?

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

You can't distribute excel.exe! And you don't need to (it's not the way!).

If you use Excel in your application, you need to install it (from the Excel installation) before you can run your application. You need a lot more than just excel.exe.

Avatar of c4mar
c4mar

ASKER

what I did is read all the data from access database then reference a excel object as worksheet. Then I dump all the information into the worksheet after I did some calcalation on the data. The new operation that I have done in here is use the worksheet as a reference.(I never done this before, that why I have a lot trouble with it) However, there a lot people have done simliar funcation before. Therefor, there must be some way to slove this problem. If you could tell more tell more detail about what should I do to solve this error?? I would be happy to accept the answer. Thanks for everything
>Therefor, there must be some way to slove this problem.

You have to install Excel on the user's PC in addition to your application!
Avatar of c4mar

ASKER

This is the place that I don't understand. All workstation has office97 full install, but I still have problem to run the application. How can a simple reference object can't run?? it doesn't make any sence to me. the only way I can think is to install VB4 into user's workstation, then the application should run without any error. But it is so silly if I have to do so...Can give me other suggestion??
You should show me the code. I think that it will be a lot easier to find the problem.

In the meantime, are you able to open Excel from a VB application and reclose it on the user's PC (much like the code bellow)?

Private Sub Command1_Click()
Dim x As Excel.Application

    Set x = New Excel.Application
    x.Visible = True
    x.Workbooks.Add
    x.ActiveSheet.Range("A1") = "Hi!!!"
   
    Stop  'Is Excel open now???
   
    x.ActiveWorkbook.Close False
    x.Quit
    Set x = Nothing
End Sub

Also, are you trying to import data into Excel (because ISAM driver are used to connect to datasource)?
Avatar of c4mar

ASKER

This foloowing code is the main function inside my application that relate with excel.
_______________________________________
Private Sub DoExcel()
Dim AppExcel As Excel.Application
Dim Wb As Excel.Workbook
Dim WS As Excel.Worksheet
Dim strSQL, msg As String
Dim i As Long, J As Long
Dim su As Double, ma1 As Double, ma2 As Double
Dim dumpvb, dumpvb2 As String

Select Case optionindex

Case 0

strSQL = "...." 'I use SQL statement in here

Case 1
strSQL = "..."

Case 2
strSQL = "..."
Case 3
strSQL = "..."
Case 4
strSQL = "..."

End Select


Set rs_client = db.OpenRecordset(strSQL)
..
..
..


rs_client.MoveLast
TotRec = rs_client.RecordCount
rs_client.MoveFirst

Set AppExcel = New Excel.Application
Set Wb = AppExcel.Workbooks.Add
Set WS = AppExcel.Worksheets.Add
ProgressBar.Max = TotRec
i = 1
J = 1


With WS.Range("A1")

rs_client.MoveFirst
' I is y j is x

Do While Val(rs_client.Fields("GL_CODE")) < 601
..
..
..


If ma1 > ma2 Then
..Offset(i - 1, 0) = rs_client.Fields("GL_CODE")
..Offset(i - 1, 1) = rs_client.Fields("DESCRIPT")
..Offset(i - 1, 2) = ma1 - ma2
..Offset(i - 1, 3) = 0
'If rs_client.Fields("GL_CODE") = "318" Then
'text_debit.Text = ma1
'text_credit.Text = ma2
'Text_result.Text = ma1 - ma2

ElseIf ma1 = ma2 Then
Else
..Offset(i - 1, 0) = rs_client.Fields("GL_CODE")
..Offset(i - 1, 1) = rs_client.Fields("DESCRIPT")
..Offset(i - 1, 2) = 0
..Offset(i - 1, 3) = ma1 - ma2
End If

ProgressBar.Value = i
If ma1 = ma2 Then
Else
i = i + 1
End If
rs_client.MoveNext
Loop



rs_client.Close

End With
ProgressBar.Value = ProgressBar.Max

AppExcel.Visible = False
Select Case optionindex
Case 0
Wb.SaveCopyAs "C:\QLD " & sdate & ".XLS"

Case 1
Wb.SaveCopyAs "C:\NSW" & sdate & ".XLS"

Case 2
Wb.SaveCopyAs "C:\VIC " & sdate & ".XLS"

Case 3
Wb.SaveCopyAs "C:\SA " & sdate & ".XLS"

Case 4
Wb.SaveCopyAs "C:\Smart" & sdate & ".XLS"

End Select

AppExcel.DisplayAlerts = False
'trun the message off, this allow excel quit the workbook without save it
Wb.Close
AppExcel.DisplayAlerts = True
'trun alerts back on once it finish close the workbook
AppExcel.Quit
Set WS = Nothing
Set Wb = Nothing
Set AppExcel = Nothing

Unload Process_menu
main_menu.Show
End Sub
_______________________________________

I have try everything that I can think off to slove the ISAM error. But until now, it just keeps on crash when I install it into other workstation and run it otver there.
Do you know which line is causing the error?
Avatar of c4mar

ASKER

there is no error when I run it,everything works. Somehow if I want to set it up as normal application setup files. It will respones "found excel 8.0 as reference. but no dependency information was avaible to locate the depednent OLE automation server. require to add manual in step 4"  in the setup wizerd application. Therefor I have no idea what have I done wrong. Anyway, I going to convert it from VB4 format into VB6 format. I want to know would the application occur error when I try to setup the application in VB6 format.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of c4mar

ASKER

actually, the funny thing is when I conver the application from VB4 to Vb6. The applcation run without any error. After I double check with the application setup wirzad, I found out VB4 didn't including one of excel 8.0 driver inside the application. Therefor when I install my applicaiton into other workstation, it will always pop up the error message when it can't find the driver. I have no idea why VB4 didn't work, maybe it is cause by VB4 that I using is special  licence to the unversity. Anyway, I just want to say thank for you to help me on this, so I would like to give the point to you. Thanks.