Hi
What have I done that is wrong
the Excell sheet will not be visible
I will have it visible
when I press the command button
Dim objXl As New excel.Application
Dim objWb As excel.Workbook
Dim xlTmp As excel.Application
Set xlTmp = excel.Application
xlTmp.Workbooks.open ("c:\kundreg\bokfaktura2.xls") '"bokfaktura2.xls"
xlTmp.Workbooks.open ("app.path & \kundreg\bokfaktura2.xls") 'don't work
'the excel sheet is not visible
' to edit the sheet I will see the sheet
On Error GoTo ErrHandler
'Set objWb = objXl.Workbooks.open("app.path & \kundreg\bokfaktura2.xls")' don't work
Set objWb = objXl.Workbooks.open("c:\kundreg\bokfaktura2.xls")
objWb.Worksheets("blad1").Range("F9") = TxtFNamn.Text
objWb.Worksheets("blad1").Range("G9") = TxtEftN.Text
objWb.Worksheets("blad1").Range("F10") = TxtAdr.Text
objWb.Worksheets("blad1").Range("F11") = TxtPostNr.Text
objWb.Worksheets("blad1").Range("G11") = TxtPostAdr.Text
objWb.Worksheets("blad1").Range("I4") = MaskEdBox1.Text
'objWb.SaveAs ("c:\kundreg\faktura\kund.xls & date.xls")
'objWb.SaveAs ("app.path & \kundreg\faktura\kund & "I4") ' don't work
ExitHandler:
On Error Resume Next
Set objWb = Nothing
objXl.Quit
Set objXl = Nothing
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation
Resume ExitHandler