Re: .dat to .xls converter
Welcome to the forums. :wave:
So basically you simply need to import a .dat file into an Excel spreadsheet, right? (Simply renaming them really isn't goint to put them in an excel format for you)
What kind of format are you .dat files in?
Re: .dat to .xls converter
.dat files are located in Server A, they are protected and cant be modified but when i copy .dat file into Server B and rename it as .xls, i'll be able able to modify it, as the original copy still in Server A, the reason am looking for a little app is because i have hundreds of these files and hardly be doing one by one and track the recent ones...
thanks for the replay anyway and i hope you could help me :)
Re: .dat to .xls converter
He can't help you unless you answer his question.
Re: .dat to .xls converter
.dat is an output from an application called SAP Front End. renaming is the easiest solution so no need for any conversion
Re: .dat to .xls converter
Sounds like they output plain text or csv. .dat is usually a catch all file extension that could be anything depending on the program making it. Luckily it's not binary.
Re: .dat to .xls converter
so is there anything i could do about it, or looks like no solution for it??!!
Re: .dat to .xls converter
You're not making sense. You said it was taken care of. Make your mind up!
Re: .dat to .xls converter
dmaruca you tool, get off his case
if you aren't gonna help him, why bother replyin?
Code:
Sub copy_files()
Dim ServerA As String
Dim ServerB As String
ServerA = "C:\temp\filename.dat" ' original filepath on Server A
ServerB = "C:\temp\filename2.xls" ' new filepath on Server B
FileCopy ServerA, ServerB
End Sub
Re: .dat to .xls converter
thanks Mitch_s_s
does that script copy the file from server A to server B and then rename it as .xls
*** sorry for the stupid question *** you can say am dummy in VB just trying to understand
how can i make search for the last updated file and then copy those recent files to server B
Re: .dat to .xls converter
Quote:
Originally Posted by mahmouddraj
does that script copy the file from server A to server B and then rename it as .xls
Yes.
Re: .dat to .xls converter
- lets pretend .dat files in this path
\\serverA\data\test.dat
and i want to copy this file to and rename as xls
\\serverB\data\test.xls
- find the latest files up-to-date and copy + rename
Re: .dat to .xls converter
just found this
here
Get Quick Access to File Properties by Using the VBA File Functions
You can quickly obtain file properties such as the created date, the last modified date, or the number of bytes in a file by using the VBA FileDateTime and FileLen functions, for example:
vb Code:
Public Sub TestFileProperties()
' Purpose: Demonstrates the use of the VBA FileDateTime
' and FileLen functions.
' Create the following file in your C:\ drive.
Const FILE_PATH As String = "C:\SampleFile.txt"
On Error GoTo TestFileProperties_Err
' List the created/modified date and the number of bytes
' for the file.
MsgBox Prompt:="'" & FILE_PATH & "' was created or last " & _
"modified on " & FileDateTime(pathname:=FILE_PATH) & "."
MsgBox Prompt:="'" & FILE_PATH & "' contains " & _
FileLen(pathname:=FILE_PATH) & " bytes."
TestFileProperties_End:
Exit Sub
TestFileProperties_Err:
Select Case Err.Number
Case 53 ' File not found.
MsgBox Prompt:="Can't find file '" & FILE_PATH & "'. " & _
"Check the file path and try again."
Case Else
MsgBox "Error number: " & Err.Number & vbCrLf & _
"Description: " & Err.Description
End Select
Resume TestFileProperties_End
End Sub