View Single Post
  #57   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Check how date is entered

On 5/8/2018 10:51 PM, GS wrote:
...

Yeah, I don't have much use for Excel's built-in import feature. In
solutions where data gets imported from plain text files, the entire
process is managed by VB[A] because the import utility will nearly almost
always misinterpret the source data. (Or at very least, cannot be trusted
to interpret accurately left to its own!)

Now as for my VB6 apps using the fpSpread.ocx, this spreadsheet control
uses cell types so importing text source data is treated according to its
target cell. How that cell displays its data is determined by its preset
format. (The fpSpread.ocx does not support ConditionalFormatting and so
this has to be done programmatically when cell type formats are not preset.
In this control, date cells will optionally include a popup calendar so
numeric input is not part of the process entering the date value because it
knows which day of which month page you selected.) Likewise, cell formats
and/or types can be set programmatically before the data is loaded into a
worksheet.

This is, IMO, a better way to handle dates than Excel offers and so as I'm
able to reproduce here what Excel features are missing, so also can I
reproduce in Excel programmatically what it lacks.

...

OK, so essentially you throw the baby out with the bath water... :)

Yeah, w/o additional tools on the Excel end, I'd write "glue" code to do what
I illustrated earlier, read the data with a tool I know I can control to
import the given format correctly before stuffing it into Excel (your
solution a different route in essence) _or_ use an intermediary filter to do
the conversion separately before Excel.

Anyway, that confirms to me Excel is, in effect, broken when you can't do the
above import without resorting to the external tool other than by the manual,
change it every time, route. Something to keep in mind if ever do get a call
again for "real" work other than the (increasingly rare) call on the plant
performance monitors for an update or the like...


Well, my solution is VBA automation of the process, which is not an external
tool. In essence, though, I agree that this part of Excel is indeed not well
thought out for things beyond general data import.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion