LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Excel VBA: Reading data from HTML-file

Hi

I have several cases, where I need to read some data from client table
(delivery prognoses), and create a text file based on those data. For every
such project, I create an Excel table where some parameters are defined, and
a macro is started, which asks for source file, opens it, reads data,
creates or opens a text file, and writes a new table into it. So long I had
Excel, text, or SCV files as source data, and Office 2000 on all users
computers, and there were no serious problems fith reading data in.


Now 2 major changes occurred. In some computers, Excel 2007 is installed.
And lately I had to convert a table provided in HTML format (Excel table
saved in HTML format). The table contains some column headings which
originally were dates formatted as "mmmdd", like MAR12, APR26, MAY03, etc.
The problem is, that depending from which computer I'm trying to convert
data, those datetext values are interpreted by Excel differently!
(I haven't tested my older projects on Office2007 jet - maybe the problem is
more serious)

I tested new application on 3 different instances: my computer (Windows 7,
Office 2007), VMWare instance on my computer (Windows XP, Office 2000), and
terminal server (Windows Server 2003, Office 2000)
On all instances, Window's regional settings are set to Estonian (i.e. short
forms for months are p.e. märts, apr, mai).

On my computer
when opening the HTML file from Excel: MAR12 is read as "MAR12", APR26
is read as 01.04.2026, MAY03 is interpereted as "MAY03"
when opening the HTML file from VBA: MAR12 is read as "MAR12", APR26 is
read as 01.04.2026, MAY03 is interpereted as "MAY03"

On VMWare instance
when opening the HTML file from Excel: MAR12 is interpreted as "MAR12",
APR26 is interpreted as 01.04.2026, MAY03 is interpereted as "MAY03"
when opening the HTML file from VBA: MAR12 is interpreted as
12.03.2010, APR26 is interpreted as 26.04.2010, MAY03 is interpereted as
03.05.2010

On Terminal Server
when opening the HTML file from Excel: MAR12 is interpreted as "MAR12",
APR26 is interpreted as 01.04.2026, MAY03 is interpereted as "MAY03"
when opening the HTML file from VBA: MAR12 is interpreted as
12.03.2010, APR26 is interpreted as 26.04.2010, MAY03 is interpereted as
03.05.2010


So it looks like Excel 2000 interpreted such date strings in files opened
directly or opened from VBA differently - and VBA handled them right way. In
Excel 2007 such date strings are handled in same way regardless was the file
opened directly or from VBA - and wrong way in both cases!

I need my applications to work regardless Excel version, as I never can
control, which version may be on user's computer.


Is there a way to resolve this problem?


Thanks in advance!
Arvi Laanemets

 
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
Copy data from an HTML file and paste into excel using a macro Karl S Excel Programming 1 March 18th 07 07:51 PM
Reading data from an excel file to access and vice versa jagdee Excel Programming 0 December 2nd 06 06:59 AM
Problem reading HTML code from Excel-VBA Erik Klausen Excel Programming 0 November 16th 06 08:58 AM
Problem reading HTML code from Excel-VBA Erik Klausen Excel Programming 0 November 16th 06 08:47 AM
How do I export excel data to an html file? Frances Excel Programming 1 December 8th 04 07:00 AM


All times are GMT +1. The time now is 08:24 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"