I need to get data from cell A1 from an excel file to a word file from which i'll be using a macro.
Suppose if i'm using a form ( in Word ) with a text box & a command button..I need the entries of A1 to be displayed in the text box
I need to get data from cell A1 from an excel file to a word file from which i'll be using a macro.
Suppose if i'm using a form ( in Word ) with a text box & a command button..I need the entries of A1 to be displayed in the text box
see the tutorial, in the FAQ thread at the top of this forum, on automation of office applications
as you give little information, it is hard to help
if workbook is already open, you can try like
vb Code:
textbox1 = getobject(fullpath\workbookname).sheets("sheet1").range("a1")
if it is not already open, you would need to create an object instance of excel, open the workbook, read the range value, close workbook and quit excel
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed![]()
pete