اذهب الي المحتوي
أوفيسنا

مشكله بالكود ربط الاكسل بالفيجوال


M.NHAKAMI

الردود الموصى بها

عندي الكود التالي بالفيجوال 2012

مكتوب اضن لا خطأ فيه والمكتبه نزلتها لكن مايعمل مايستورد لي بيانات الخلايا المحدده ممكن اعرف الخطأ اين 

Imports Microsoft.Office.Interop
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim xl As New Excel.Application
        Dim xlw As Excel.Workbook

        xlw = xl.Workbooks.Open(My.Application.Info.DirectoryPath & "\Test.xls")
        xlw.Sheets("sheet1").select()
        TextBox1.Text = xlw.Application.Cells(1, 1).value
        TextBox2.Text = xlw.Application.Cells(1, 2).value
        TextBox3.Text = xlw.Application.Cells(1, 3).value
        xlw.Close()
        xlw = Nothing
        xl = Nothing
    End Sub
End Class 

 

screen.rar Microsoft.Office.Interop.Excel.rar

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information