View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Open dbf file then close. do nothing..ignore any message.

Workbooks.Open Filename:=fileToOpen

should be identical to do File=Open and selecting your file in the dialog.

If there are more than 65535 records, then yes, you will not get all the
data, but that would be true for doing it manually.

If you say you have a manual methods that does what you want, then turn on
the macro recorder and perform that manual method. Then turn off the macro
recorder and look at the recorded code.

To suppress alerts

Application.DisplayAlerts = False
' code that could cause an alert
Application.DisplayAlerts = True




--
Regards,
Tom Ogilvy

"musa.biralo" wrote in message
ups.com...
Hi,
i am simply trying to open a dbf file then close it without doing
anything and do not want to notify the user plus if any message comes
out i want to ignore it...(opening in the background)... i tried with,

'fileToOpen = "c:/path/musa.dbf"
'filenumber = FreeFile
'Open fileToOpen For Random Access As #filenumber
'Close #filenumber

it did nothing....then i tried with...

'Workbooks.Open Filename:=fileToOpen
'ActiveWindow.Close

this opens up the dbf file in excel and the problem is i have more data
than the excel limit so i got a message.....

Is there a way to open a dbf file in the background and close it
without doing anything to it and ignore any message??...what i found
is, without opening the file, excel can not get the data from the
file....So, just want to open then colse.....doing this thing manually,
everything works ok.

Thank you for you time...

musa.biralo