Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Reading Excel Checkboxes in Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Risky_Business - 29 May 2007 22:07 GMT
Hi All
I created a spreadsheet with checkboxes (controls) on it for reporting
purposes.  I now need to import the data contained on the spreadsheets
into Access.  The data is not laid out in neat columns or rows, it was
formated to be a stand alone report originally.  My problem is not in
reading cells within the spreadsheet, I'm able to do that.  My issue
is that I can't tell if a checkbox is checked or not.

What I've done:

If I execute the following code in Excel I return a boolean
partAM = CheckBox15.Value
I return true or false

Here is my access code:
Set xlapp = New Excel.Application

Set xlwb = xlapp.Workbooks.Open(f)

Set xlws = xlwb.Sheets("sheet1")

dte = Cells(4, 4)
adt = Cells(6, 4)
cse = Left(Cells(8, 4), 7)
cert = Mid(Cells(8, 4), 8, 4)
lname = Trim(Cells(10, 4))
fname = Trim(Cells(12, 4))
partAM = CheckBox15.Value

xlwb.Close
Set xlapp = Nothing

Set xlwb = Nothing
Set xlws = Nothing

Why does this code work in Excel but not Access???

Thanks a ton in advance
Brendan Reynolds - 30 May 2007 12:42 GMT
> Hi All
> I created a spreadsheet with checkboxes (controls) on it for reporting
[quoted text clipped - 34 lines]
>
> Thanks a ton in advance

Well I'm guessing, because you haven't told us what happens when you try to
execute this code in Access, but my first guess would be that you probably
need to qualify the references to members of the Sheet object by specifying
their parent object, e.g. something like "dte = xlws.Cells(4.4)" rather than
just "dte = Cells(4,4)".

Signature

Brendan Reynolds

Risky_Business - 30 May 2007 16:19 GMT
the dte = Cells(4,4) part of the code is working fine.  My issue is
trying to read the Checkbox. I tried refering to the the worksheet
e.g.  partAM = xlb.xls.CheckBox15.Value  and my variable was still
empty.  I've checked Excel9 Referance, is there a control referance
that I need to check too?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.