[AccessD] Pulling Data from Excel into Access with "Automation"

Stuart McLachlan stuart at lexacorp.com.pg
Fri Jul 1 16:57:41 CDT 2011


ONly change I'd make is:

<quote> Dim Str_Value_in_Cell As Variant </quote>

I'd make that Var_Value_in_Cell :-)

-- 
Stuart

On 1 Jul 2011 at 13:26, Brad Marks wrote:

> Steve, William, Darryl,
> 
> Thanks for the help with my questions.  
> 
> The advice that you provided has helped me move forward.
> 
> Below is a stripped down snippet of the Access 2007 VBA code that I
> put together based on the advice you provided.
> 
> I am going to post it here in case some other "newbie" is looking for
> the very "basic basics" and I am posting it here to see if anyone sees
> a problem with the direction that I am heading.
> 
> Thanks again,
> Brad
> 
> PS.  I also ordered a book on this subject.
> 
> '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Sub Pull_Data_From_Excel_Into_Access()
> 
> Dim XLApp As Excel.Application
> 
> Dim XLWorkbook As Excel.Workbook
> 
> Dim XLSheet As Excel.Worksheet
> 
> Dim Str_Value_in_Cell As Variant
> 
> Set XLApp = CreateObject("Excel.Application")
> 
> XLApp.Workbooks.Open ("C:\Book1.xlsx")
> 
> XLApp.Visible = True   ''' to see Spreadsheet
> 
> Set XLWorkbook = XLApp.Workbooks(1)
> 
> Set XLSheet = XLWorkbook.Sheets(1)
> 
> Str_Value_in_Cell = XLSheet.Cells(1, 1).Value
> 
> MsgBox Str_Value_in_Cell
> 
> End Sub
> 
> '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 






More information about the AccessD mailing list