slm
Private ExcelApp As Excel.Application
Private ExcelWb As Excel.Workbook
Public Sub SetCellContent(Filename As String, _
sWorksheet As String, _
sCell As String, _
NewValue As String)
On Error GoTo ErrHandle
Set xlUserform1 = Nothing
Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWb = ExcelApp.Workbooks.Open(Filename)
ExcelWb.Worksheets(sWorksheet).Range(sCell).Value = NewValue
ExcelWb.Save
ExcelWb.Close SaveChanges:=False
ExcelApp.Quit
Set ExcelApp = Nothing
Set ExcelWb = Nothing
Exit Sub
ErrHandle:
MsgBox "Allgemeiner Fehler... : " & _
Err.Description & " " & _
"Fehlernummer : " & _
Err.Number
Resume Next
End Sub
burada VB6 Text1 veri yazdigimda Excelin A1 hücresine yaziyor.....
bu kodun son bölümü , kod güzel calisiyor.
fakat Excel Userform ile acildiginda problem oluyor.
dim xlUserform as object
set xlUserform=Nothing
tanimi yaptigimda da kod verimli calismiyor.
saygilar
Private ExcelApp As Excel.Application
Private ExcelWb As Excel.Workbook
Public Sub SetCellContent(Filename As String, _
sWorksheet As String, _
sCell As String, _
NewValue As String)
On Error GoTo ErrHandle
Set xlUserform1 = Nothing
Set ExcelApp = CreateObject("Excel.Application")
Set ExcelWb = ExcelApp.Workbooks.Open(Filename)
ExcelWb.Worksheets(sWorksheet).Range(sCell).Value = NewValue
ExcelWb.Save
ExcelWb.Close SaveChanges:=False
ExcelApp.Quit
Set ExcelApp = Nothing
Set ExcelWb = Nothing
Exit Sub
ErrHandle:
MsgBox "Allgemeiner Fehler... : " & _
Err.Description & " " & _
"Fehlernummer : " & _
Err.Number
Resume Next
End Sub
burada VB6 Text1 veri yazdigimda Excelin A1 hücresine yaziyor.....
bu kodun son bölümü , kod güzel calisiyor.
fakat Excel Userform ile acildiginda problem oluyor.
dim xlUserform as object
set xlUserform=Nothing
tanimi yaptigimda da kod verimli calismiyor.
saygilar