Column width first column with (choose folder) as string

Hi all

When I use (choose folder) as string in the script editor the column width of the first column is OK.

But when I call the line from VBA like this

Dim folderPath
On Error Resume Next
folderPath = MacScript("choose folder as string")
On Error GoTo 0

The first column is very small so I can’t read the folder names and must drag the column wider.

Is there something in Applescript I can do to set the width of the first column

Hi
try this

set column width of range "A:A" to 27 --# characters 

bills

Hi Bills

I am talking about the name column in the choose folder dialog not
the first column in Excel

Can’t you just widen the dialog, or hit the button at the side of the parent folder name, so it expands to a dialog?

Try to enlarge the first column with pressed option key.
Normally then the width persists

Hi Guys

Sure I can make the column wider each time but that’s not a very friendly way each time.

Enlarge with Option key is working in when you call it with Apple script in the editor.

Within a VBA macro it will not work, for example

Sub Select_Folder_On_Mac()
Dim folderPath As String
Dim RootFolder As String

On Error Resume Next
RootFolder = MacScript("return (path to desktop folder) as String")
'Or use RootFolder = "Macintosh HD:Users:YourUserName:Desktop:TestMap:"
folderPath = MacScript("(choose folder with prompt ""Select the folder""" & _
"default location alias """ & RootFolder & """) as string")
On Error GoTo 0

If folderPath <> "" Then
    MsgBox folderPath
End If

End Sub

Maybe you could tell Finder to choose Folder for you? :slight_smile: