LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default How do I add a File Open box to this script???

Perhaps you're after something like:

Sub test()
Dim strFile As String

strFile = Application.GetOpenFilename("SPF Files (*.spf), *.spf")
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"maleemi" wrote in message
om...
The Basic Script below was captured using Excels "Record Macro"
feature. As recorded, it opens the file: "TEXT;P:\WB Test\Aspen Sample
Mail Files\020604\mailing\new\SBELECPRD_9111140388.SPF; 1" and performs
a series of actions on the file.

Instead of opening a specific file I would like this macro to instead
launch an "Open File" Dialog box to allow me to specify which file
will be processed.

Can anyone tell me how to add the "Open File" dialog to this macro?

Best Regards,

Marcel




Sub Process_Aspen_Mail_File()
'
' Process_Aspen_Mail_File Macro
' Macro recorded 2/5/2004 by preprint
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;P:\WB Test\Aspen Sample Mail
Files\020604\mailing\new\SBELECPRD_9111140388.SPF; 1" _
, Destination:=Range("A1"))
.Name = "SBELECPRD_9111140388.SPF;1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2)
.Refresh BackgroundQuery:=False
End With



 
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
what would the script look like to open a new sheet des-sa[_2_] Excel Discussion (Misc queries) 1 July 16th 08 06:47 PM
How to do something in an VBS script for all worksheets of an Excel file? Claudia d'Amato Excel Discussion (Misc queries) 9 June 26th 08 10:53 PM
simple vb script to open, refina Excel Discussion (Misc queries) 0 June 14th 08 07:37 PM
Script to save Excel file to the server. raj41977 Excel Discussion (Misc queries) 3 December 8th 05 02:48 PM
Create an .xls file by script Mark Powell Excel Programming 0 August 14th 03 11:54 PM


All times are GMT +1. The time now is 08:56 AM.

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

About Us

"It's about Microsoft Excel"