[AccessD] Open CSV file using Excel object and save as Excel

Paul Hartland (ISHARP) paul.hartland at isharp.co.uk
Fri Oct 29 09:33:06 CDT 2004


Bryan,

Yes it's pointing to the Excel 8.0 object library, using Access 97.  The CSV
file by the way has Unix end of line characters if that makes a
difference...

Paul

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bryan Carbonnell
Sent: 29 October 2004 15:17
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Open CSV file using Excel object and save as Excel


On Fri, 29 Oct 2004 14:49:58 +0100, Paul Hartland (ISHARP)
<paul.hartland at isharp.co.uk> wrote:
> Yes see original code sent below:

> >> I have the following code in a database:
> 
> >>     Dim objExcel As Excel.Application
> >>     Dim objWB As Excel.Workbook
> >>     Dim strSaveAs As String
> 
> >>     Set objExcel = New Excel.Application
> >>     Set objWB = objExcel.Workbooks.OpenText(strLoc)    ' NOTE: strLoc
is
> a
> >> path provided by the user
> 
> >>     strSaveAs = Left(strLoc,((Len(Trim(strLoc))-4)) & ".xls"
> 
> >>     objWB.SaveAs strSaveAs
> 
> >>     objWB.Close
> >>     Set objWB = Nothing
> >>     objExcel.Quit
> >>     Set objExcel = Nothing

I meant from the VBE Tools| References and then select Microsoft Excel x.0
Object Library

not dimming a variable.

-- 
Bryan Carbonnell - carbonnb at gmail.com
Life's journey is not to arrive at the grave safely in a well preserved
body, but rather to skid in sideways, totally worn out, shouting "What a
great ride!"
-- 
_______________________________________________
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