[AccessD] slightly off the topic of Excel to csv #Num!

William Thompson william.thompson1 at att.net
Tue Nov 23 21:33:02 CST 2004


This is not exactly what you specified, but it looked interesting:
http://support.microsoft.com/kb/247412/EN-US/

<snippet>
Dim rs As ADODB...
...
sData = rs.GetString(adClipString, , vbTab, vbCr, vbNullString)
   Open "C:\Test.txt" For Output As #1
   Print #1, sData
   Close #1
...
Shell "C:\Program Files\Microsoft Office\Office\Excel.exe " & _
      Chr(34) & "C:\Test.txt" & Chr(34), vbMaximizedFocus

A possible way to re-engineer this - with potential for improvement - would
be to create a querytable from a recordset, then write out a 'mirror' csv
file.  I've been looking at this type of thing for 'snapshots' of data that
is constantly being refreshed, or to make dynamic data static.

Bill

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby
Sent: Tuesday, November 23, 2004 6:08 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] #Num!

I keep forgetting about this method.  I have never automated Excel to save a
sheet as a csv.  Does anyone have working code to do this?

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, November 23, 2004 7:42 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] #Num!


Hi John

That's not nice. Who makes such spreadsheets?

How about saving (via code) the worksheet to a text file (.csv) and then
read this line by line validating the fields? Not very fancy, I know, but
what options are left?

/gustav

>>> jwcolby at colbyconsulting.com 23-11-2004 13:10:09 >>>
I'm trying to import it into a temp table and get a "numeric overflow" when
trying to do the append.  This even though I have converted ALL of the
fields to text.  The issue is coming from a date field with null in the
first record (but dates in most of the rest).  

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/ 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, November 23, 2004 6:05 AM
To: accessd at databaseadvisors.com 
Subject: Re: [AccessD] #Num!


Hi John

I don't think you can. 
An option might be to import the worksheet to a temp table. Then you can
manipulate the data as you wish.

If you find a method please let us know.

/gustav

>>> JColby at dispec.com 22-11-2004 19:23:39 >>>
Does anyone know how to convert #Num! in a linked spreadsheet to a null or
something useable in Access?

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



-- 
_______________________________________________
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