ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening dif format sheet via VBA (https://www.excelbanter.com/excel-programming/347710-opening-dif-format-sheet-via-vba.html)

It'sme

Opening dif format sheet via VBA
 

Hi all,
I have something odd happening when trying to open a sheet via a VB
macro.

I download a file from a midrange system as a DIFF file format t
import into MS Excel 2003via a simple VBA Macro.

Now when I open that sheet manually, there is a date column which i
formatted as ddmmyyyy and it displays correctly. This is the dat
format I need.

When my macro opens that same sheet, then the date gets reversed a
mmddyyyy.

The vba code I am using (and copying in here freehand) is very straigh
forward:

Code
-------------------

Sub LoadData()
Dim ipname
ipname = "I12dailyCPT.xls"
Workbooks.Open FileName:=
"C:\Documents and Settings\Itsme\Desktop\" & ipname"
End Sub

-------------------


As I say when I look at the sheet that when opened by the macro tha
date is changed around. The first thing I do after loading the sheet i
to validate the date so I'm kinda stuck :confused:

I need to understand why this is happening before I can even thin
about how to fix it or work around it.

Greatly appreciate any help

--
It'sm
-----------------------------------------------------------------------
It'sme's Profile: http://www.excelforum.com/member.php...fo&userid=2950
View this thread: http://www.excelforum.com/showthread.php?threadid=49211



All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com