LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to skip "unrecognizable" msg when opening Workbook

I use the following code to try and open a downloaded csv file:
========================

Function OpenCSVFile(csvFileName) As Boolean
On Error GoTo FailedOpen

Application.Workbooks.Open csvFileName
OpenCSVFile = True
Exit Function

FailedOpen:
OpenCSVFile = False

End Function
==================

Sometimes the CSV is not guaranteed to be readable, and when it can't open,
a dialogue comes up saying "This file is not in a recognizable format." I
would hope this would be caught by "On Error", but it doesn't catch it. It's
a large batch process and I don't want it to be halted by a bad CSV file, i
want the error to be logged and continue.

Any idea on how I can prevent this? A way to supress the dialogue, or to
check a file for validity before even trying to open it?

Thanks,
Mayhew

 
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
Slow opening of "in use" workbook Kurosh Excel Discussion (Misc queries) 1 November 9th 07 10:54 PM
"Running Virus Scan" ....On Opening Excel Workbook Dermot Excel Discussion (Misc queries) 1 August 30th 07 09:17 PM
How do I automatically "enable Macros" when opening a workbook RobertWNewson Excel Programming 1 April 11th 06 05:51 PM
Emptying cache or "history" before opening workbook windsurferLA Excel Programming 2 February 15th 05 06:30 PM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


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