Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Import files on a mac

Hello!

I wrote on a PC a macro to import more then one file.
Here is the code to geht the paths of the files, chosen in the dialog
window:
On th PC there were no errors
-----------------
Public

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

varRetVal = Application.GetOpenFilename( _
FileFilter:="Text-Datein (*.txt), *.txt", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen", _
MultiSelect:=True)
MsgBox (varRetVal(1) & " " & varRetVal(2))
End Sub


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

now i tried to use the macro on a Mac (OSX, newest Office version),
i adopt the code = (FileFilter:="Text")

-----------------
Public

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

varRetVal = Application.GetOpenFilename( _
FileFilter:="TEXT", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen", _
MultiSelect:=True)
MsgBox (varRetVal(1) & " " & varRetVal(2))
End Sub


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

But there is still an error. I think that there a problems with
"MultiSelect:=True". Without this comand its possible to import one
File.

hope someone knows how to help me
thx
Andy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Import files on a mac

Multiselect is not implemented in MacXL. You'll need to loop.



In article ,
Andreas Roschger wrote:

Hello!

I wrote on a PC a macro to import more then one file.
Here is the code to geht the paths of the files, chosen in the dialog
window:
On th PC there were no errors
-----------------
Public

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

varRetVal = Application.GetOpenFilename( _
FileFilter:="Text-Datein (*.txt), *.txt", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen", _
MultiSelect:=True)
MsgBox (varRetVal(1) & " " & varRetVal(2))
End Sub


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

now i tried to use the macro on a Mac (OSX, newest Office version),
i adopt the code = (FileFilter:="Text")

-----------------
Public

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

varRetVal = Application.GetOpenFilename( _
FileFilter:="TEXT", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen", _
MultiSelect:=True)
MsgBox (varRetVal(1) & " " & varRetVal(2))
End Sub


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

But there is still an error. I think that there a problems with
"MultiSelect:=True". Without this comand its possible to import one
File.

hope someone knows how to help me
thx
Andy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Import files on a mac

Multiselect is not implemented in MacXL. You'll need to loop.

May you give me an example of such a loop.
thx
Andy
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Import files on a mac

Maybe??

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

do

varRetVal = Application.GetOpenFilename( _
FileFilter:="Text-Datein (*.txt), *.txt", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen")

if varRetVal = false then exit do

MsgBox varRetVal

loop

End Sub

Andreas Roschger wrote:

Multiselect is not implemented in MacXL. You'll need to loop.


May you give me an example of such a loop.
thx
Andy


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Import files on a mac

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

do

varRetVal = Application.GetOpenFilename( _
FileFilter:="Text-Datein (*.txt), *.txt", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen")

if varRetVal = false then exit do

MsgBox varRetVal

loop

End Sub


thx, but the problem is, that i have to import a lot of files....
any possibility to automate this?

Andy


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Import files on a mac

Hmmm. I thought that this _was_ automated!

But if the filenames don't change, then maybe you could put all the names in a
worksheet and loop through that list.

From reading JE's post, it doesn't look like Mac's can get more than one file at
a time--using .getopenfilename.

I don't have any idea if there's a workaround solution on those Macs.



Andreas Roschger wrote:

Sub DateinEinlesn()
Dim varRetVal As Variant
Dim n As Integer

do

varRetVal = Application.GetOpenFilename( _
FileFilter:="Text-Datein (*.txt), *.txt", _
Title:="Eine oder mehrere Dateien zum Öffnen auswählen")

if varRetVal = false then exit do

MsgBox varRetVal

loop

End Sub


thx, but the problem is, that i have to import a lot of files....
any possibility to automate this?

Andy


--

Dave Peterson
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 txt files into Excel Basta1980 Excel Discussion (Misc queries) 7 January 10th 08 02:03 PM
Import Several .txt Files Renee B. Excel Discussion (Misc queries) 2 October 3rd 07 07:06 PM
import files Hollis Excel Programming 2 November 29th 04 08:27 PM
Import and Rename Files rickey24[_7_] Excel Programming 1 July 7th 04 02:43 AM
Import multiple files macro can't find files Steven Rosenberg Excel Programming 1 August 7th 03 01:47 AM


All times are GMT +1. The time now is 10:46 AM.

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"