Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Import of Database VB app into Excel Spreadsheet

Original Question:

We have a Database program here (SQL not Access) that
exports reports to Excel. These reports contain odd
combinations of numbers that mean something to the users
of the database and to the programmers of it, but not to
me. Anyway, I recently upgraded from Office 2000 on our
terminal server (Win2K) to Office XP. Since then the
num,bers in this worksheet are being truncated and the
formats are changing. For instance, a number such as
2E152 appears as 2.00E+152 or something like 0100a will
appear as 1:00 AM, we are also having the leading 0's

for a number deleted. I know how I can change the format
for each cell individually, but how can I change the
formatting for cells in the entire spreadhseet to read
the numbers as text only. Or some other fix would be
great. I have Office XP on a nother server and this export
isn't goofed like this. Don't understand it and have too
much to do to spend more time on it so any help would be
awesome! Thanks!

Answer #1
It would depend on what you mean by export. If it is
exported as a text file (but not .csv), then imported, you
can import it manually through file=Open which will
invoke the text import wizard. On the last dialog of
the wizard, you can specify to treat specific columns as
text and no conversion will take place. Do this with the
macro recorder turned on to get the code to import it
without going through the text import wizard, but
still use the settings you specified.

Other than that, I think you would have to elaborate on
the format of the file that is exported.

Excel is seeing 2E152 as being a number in scientific or
exponential notation. This is pretty standard, so I am
not sure why earlier versions were not having a similar
problem. Same with 0100a being seen as a time
value. Leading zeros are lost when the value is stored
as a number again, this is pretty common in all versions
as well. For some reason, the machines without the
problems must have treated these columns as Text.


Regards,
Tom Ogilvy


Reply to answer:
The export is happening inside a VB6.0 Application.

The excel object is opened and a worksheet created.

We fill the cells using the .copyfromrecordset method of
the cell object within the excel object.

The load point for Office XP for the working system is
different from the load point for the non-working system.
Maybe some pre install features were configured
differently, not sure. I was just wondering if there may
be some registry changes I could make so the default cell
category is text.

Thanks,
Donna
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import New Database Query (Union Query) in Spreadsheet klock Excel Discussion (Misc queries) 2 September 24th 09 01:30 AM
Import from Excel into database using jet in VB.net Andy HP Excel Discussion (Misc queries) 0 February 7th 08 08:33 AM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
import paradox database into excel fange Excel Discussion (Misc queries) 1 August 19th 05 03:20 PM
Import from Database using field from excel. BD Excel Discussion (Misc queries) 1 May 10th 05 10:31 PM


All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"