+ Reply to Thread
Results 1 to 5 of 5

Dialog box "xlDialogOpenText" don't work

  1. #1
    Registered User
    Join Date
    12-15-2005
    MS-Off Ver
    2010
    Posts
    31

    Dialog box "xlDialogOpenText" don't work

    Hi,
    When I used statement like "Application.Dialogs.Item(xlDialogOpen).Show , False, True", it works fine and able to call up "open file" dialog box.


    But when I used statement
    "Application.Dialogs.Item(xlDialogOpenText).Show"
    OR even with parameter as
    "Application.Dialogs.Item(xlDialogOpenText).Show "C:\T.txt", 437, 2, xlDelimited, xlDoubleQuote, False, True, True, Flase, False, False, , Array(Array(1, 1), Array(2, 1)")

    it don't work. It pop up error message saying "Run Time Error 1004. Application-defined or object defined error". Please let me know what going wrong and how to solve it?

    Thanks.

  2. #2
    Registered User
    Join Date
    08-19-2007
    Posts
    40

    xlDialogOpenText

    Hi leecs

    The reason why you are receiving this error, is that it is complaining that there is no constant for xlDialogOpenText under Dialogs. which is why you are receiving this runtime error.

    Please try the following example below.

    Application.Dialogs(xlDialogTextToColumns).Show "C:\T.txt", 437, 2, xlDelimited, xlDoubleQuote, False, True, True, False, False, False, , Array(Array(1, 1), Array(2, 1))

    Hope this helps.

    Regards,

    Steven Daniel
    ONTRACK SOFTWARE & TECHNOLOGY SOLUTIONS
    http://www.ontrack-software.com.au/

  3. #3
    Registered User
    Join Date
    12-15-2005
    MS-Off Ver
    2010
    Posts
    31
    Dear Steven,
    Thank you very much.
    But no luck. I try and some error message appear. So I attach the files and I hope it may help to figure up the problem. Please help.

    My intention is to capture parameter used for OpenText dialog. Then those parameters can be saved and also used for next batch of similar pattern of text file . ( I try to prevent record macro for every pattern of text file).

    Thanks. Regards,

    From, Lee CS
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Have a look at

    http://support.microsoft.com/kb/117412

    This is a follow on from the response from Steven.

    Basically, while it has the relevant code and arguments, it will not raise an interactive dialog.

    There are various alternatives. Here's a link to one

    http://www.vbforums.com/archive/index.php/t-366132.html

    HTH

    rylo

  5. #5
    Registered User
    Join Date
    12-15-2005
    MS-Off Ver
    2010
    Posts
    31
    Dear Rylo,
    Thank you very much. I have better understand now. (I am now study the alternative way follow the link above).
    Thanks.

    Regards, Lee CS.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1