K
kennytwk via AccessMonster.com
hi all experts and grandmasters,
i have bind an Ms excel 11.0 object to my Access form, i have a textbox and a
command button in "Form A", when i enter an Ms Excel file name to the textbox
box and click the command button , "Form B" will appear, now, my ms excel 11.
0 object( let's name it Spreadsheet0) is in my "Form B(CodeList)". I need
whatever i have in my the Excel file to show in the ms excel 11.0 object
(Spreadsheet0). is it possible?
here is the code
Dim excelWorkbook As Excel.Workbook
If IsNull(Me.Text0) Then
MsgBox "Please key in the exact file name, thank you", vbOKOnly
Else
' Please note i know what the code below does, i dont want to open the
file, i just want to retrive
' the data in the file and display it in my ms excel 11.0 Object which i
have embeded in my form.
' many many many many thanks, been stuck for dayssssssssssss, gonna start
banging wall soon
Set excelWorkbook = GetObject("C:\" & Me.Text0 & ".xls")
excelWorkbook.Application.Visible = True
excelWorkbook.Application.Windows("" & Me.Text0 & ".xls").Visible = True
stDocName = "CodeList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
notice that i didn't close or save the object, i will leave it to another
button to do it, my situation right now is i need to sort of display the data
in my excel file to the object(Spreadsheet0) in my Form B(CodeList), is it
possible? or do i need to use import ??
another question, if i use import, correct me if i am wrong, we have to use
xml ?, does anyone have any idea of a good website for xml or ms excel 11.0
object library?
KT
i have bind an Ms excel 11.0 object to my Access form, i have a textbox and a
command button in "Form A", when i enter an Ms Excel file name to the textbox
box and click the command button , "Form B" will appear, now, my ms excel 11.
0 object( let's name it Spreadsheet0) is in my "Form B(CodeList)". I need
whatever i have in my the Excel file to show in the ms excel 11.0 object
(Spreadsheet0). is it possible?
here is the code
Dim excelWorkbook As Excel.Workbook
If IsNull(Me.Text0) Then
MsgBox "Please key in the exact file name, thank you", vbOKOnly
Else
' Please note i know what the code below does, i dont want to open the
file, i just want to retrive
' the data in the file and display it in my ms excel 11.0 Object which i
have embeded in my form.
' many many many many thanks, been stuck for dayssssssssssss, gonna start
banging wall soon
Set excelWorkbook = GetObject("C:\" & Me.Text0 & ".xls")
excelWorkbook.Application.Visible = True
excelWorkbook.Application.Windows("" & Me.Text0 & ".xls").Visible = True
stDocName = "CodeList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
notice that i didn't close or save the object, i will leave it to another
button to do it, my situation right now is i need to sort of display the data
in my excel file to the object(Spreadsheet0) in my Form B(CodeList), is it
possible? or do i need to use import ??
another question, if i use import, correct me if i am wrong, we have to use
xml ?, does anyone have any idea of a good website for xml or ms excel 11.0
object library?
KT