Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Suppress File Selection Dialog box

Posted before but got scrolled to page 9 with no responses.

I have some code that is importing a specific file based on some variables
input into some input boxes. The files will always have the same naming
scheme and the macro will import the correct file based on the code and
variables. My problem is that the code is opening a dialog box in order to
select the file. My code already selects the file but the user has to hit ok
in order to move on. I want to suppress this dialog box as the code should
be doing the selecting of the file. I've attempted turning the DisplayAlerts
to false and it hasn't worked to suppress the box. I've searched the board
for all of the keywords I can think of without any success. Thank you in
advance for your assistance. See code below.

Thank you,
Brian

Sheets("Sheet1").Select
Range("A1").Select
With Selection.QueryTable
.Connection = _
"TEXT;\\maninfs1\account\FINANCE\" & Year & "\" & Month &
"\Files\ShowProfit" & Year & "" & Month & ""
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(30, 8, 13, 16, 19, 17)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Suppress File Selection Dialog box

Brian,

Try adding ".TextFilePromptOnRefresh = False" to your list of arguments for
the QueryTable.

i.e.

With Selection.QueryTable
' SKIP LINES TO CLIP POST SIZE - leave your old lines here!
.Refresh BackgroundQuery:=False
.TextFilePromptOnRefresh = False ' new line
End With
End With

Regards,

George

"BCBarney" wrote:

Posted before but got scrolled to page 9 with no responses.

I have some code that is importing a specific file based on some variables
input into some input boxes. The files will always have the same naming
scheme and the macro will import the correct file based on the code and
variables. My problem is that the code is opening a dialog box in order to
select the file. My code already selects the file but the user has to hit ok
in order to move on. I want to suppress this dialog box as the code should
be doing the selecting of the file. I've attempted turning the DisplayAlerts
to false and it hasn't worked to suppress the box. I've searched the board
for all of the keywords I can think of without any success. Thank you in
advance for your assistance. See code below.

Thank you,
Brian

Sheets("Sheet1").Select
Range("A1").Select
With Selection.QueryTable
.Connection = _
"TEXT;\\maninfs1\account\FINANCE\" & Year & "\" & Month &
"\Files\ShowProfit" & Year & "" & Month & ""
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(30, 8, 13, 16, 19, 17)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With



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
The file association dialog won't allow selection of Excel juancarlos1688 Setting up and Configuration of Excel 2 April 8th 08 08:06 AM
Suppress File Selection Box BCBarney Excel Programming 2 March 25th 08 06:07 PM
How do I suppress user dialog in File Save As? Tony Lin[_2_] Excel Programming 1 March 29th 06 08:56 AM
Suppress Save Dialog Box r wilcox Excel Programming 4 September 7th 05 01:14 PM
How-To suppress a warning dialog James Excel Programming 2 August 11th 04 08:36 PM


All times are GMT +1. The time now is 09:42 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"