Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default change type of a file

I need code which take file from type file and change the type to be excel file
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default change type of a file

I'm not at all sure what you mean, but you can change the name of
a file with code like


Name "H:\test2" As "H:\test2.xls"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"????" wrote in message
...
I need code which take file from type file and change the type
to be excel file



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default change type of a file

It's answer the quaton that I asked, but I need same thing a little bet maor
compicated.
I can use the file name becuse there is a loop that opens all the files in
the same folder.
Here is the code the line that shifting right is problematic(it got an erro
mesage object doesn't supporat this property or methode ). I will be happy if
same one would be able to deal with it
thanks

Dim oFSO

Sub LoopFolders()
Dim i As Integer

Set oFSO = CreateObject("Scripting.FileSystemObject")

selectFiles "c:\MyTest"

Set oFSO = Nothing

End Sub


'---------------------------------------------------------------------------
Sub selectFiles(sPath)
'---------------------------------------------------------------------------
Dim Folder As Object
Dim Files As Object
Dim file As Object
Dim fldr

Set Folder = oFSO.GetFolder(sPath)

For Each fldr In Folder.Subfolders
selectFiles fldr.Path
Next fldr

For Each file In Folder.Files
Workbooks.Open Filename:=file.Path

Name ActiveWorkbook As
file.Path.xls


ActiveWorkbook.Save
ActiveWorkbook.Close
Next file

End Sub


"Chip Pearson" wrote:

I'm not at all sure what you mean, but you can change the name of
a file with code like


Name "H:\test2" As "H:\test2.xls"



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"????" wrote in message
...
I need code which take file from type file and change the type
to be excel file




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
change type of a file ditzafar[_12_] Excel Programming 0 January 5th 06 10:56 AM
how to change all the words of one type(Gunsuh type)to another metumevlut Excel Discussion (Misc queries) 2 November 11th 05 03:29 PM
How do I change file/open/"files of type" to default to "all file. How do I changefiles of type default Excel Discussion (Misc queries) 1 April 19th 05 10:45 PM
how a file can change its type from '.xls' to '.tmp' puzzled Excel Discussion (Misc queries) 2 February 18th 05 10:54 PM
Export an excel file as text without change of document type Michael[_36_] Excel Programming 1 January 21st 05 02:33 PM


All times are GMT +1. The time now is 09:55 PM.

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

About Us

"It's about Microsoft Excel"