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 / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

OpenText question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dlevine54 - 30 Nov 2005 14:39 GMT
have an Access database from which I create a CSV file. Now they want an
XLS spreadsheet also. Since I already have the CSV I want to use that to
create the spreadsheet but can't. I'm using Office 2003. My code is below.

       Dim oExcel As Object
       Dim oBook As Excel.Workbook
       Dim oBooks As Excel.Workbooks
       Dim oSheets As Excel.Sheets
       Dim oSheet As Excel.Worksheet
         
       ' Open the excel spreedsheet
       Set oExcel = CreateObject("Excel.Application")
       Set oBook = oExcel.Workbooks.Add()
       Set oBook = oExcel.Workbooks.OpenText(CSV_doc_name, StartRow:=3, _
           DataType:=Excel.XlTextParsingType.xlDelimited, Comma:=True)
       oBook.Close
       Set oExcel = Nothing

I keep getting an 'Object is required' error on the OpenText line. Can
someone help me understand why?
OfficeDev18 - 30 Nov 2005 15:20 GMT
Why re-invent the wheel? All you need to do is use the DoCmd.TransferText and
DoCmd.TransferSpreadsheet statements. See the TransferX methods in the Help
for details and usage.

HTH

> have an Access database from which I create a CSV file. Now they want an
>XLS spreadsheet also. Since I already have the CSV I want to use that to
[quoted text clipped - 16 lines]
>I keep getting an 'Object is required' error on the OpenText line. Can
>someone help me understand why?

Signature

Sam

 
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.