Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import txt files into Excel | Excel Discussion (Misc queries) | |||
Import Several .txt Files | Excel Discussion (Misc queries) | |||
import files | Excel Programming | |||
Import and Rename Files | Excel Programming | |||
Import multiple files macro can't find files | Excel Programming |