LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Open a GroupWise .NAB File

On 29/09/2011 23:22, salgud wrote:
On Thu, 29 Sep 2011 22:06:23 +0100, Martin Brown wrote:

On 29/09/2011 21:24, salgud wrote:
On Thu, 29 Sep 2011 12:44:01 -0700, Gord wrote:

Have you tried popping up the fileopen dialog box?

Application.Dialogs(xlDialogOpen).Show

Pick the *.nab file you want to open and your code does the rest.

As far as naming the resultant file..........that's another story<g


Gord Dibben Microsoft Excel MVP




Thanks for your reply. Unfortunately, that won't work. When the .NAB file
is opened by XL, it automatically starts the conversion process to make it
into an XL file. So the macro can't even be started until that is
completed. Once that's completed, the first part of the macro, which sets
the conversion settings normally done manually, is not needed, and if left
in, trashes the file. I need some way to intervene, (maybe some event
driven code?) and take over the process. Maybe it looks at the file name,
and if it sees the .NAB extension, offers to take over, or detects the file
import routine and offers to take over. But I have never tried to do
anything like that, and don't have a clue where to start.


Use Application.GetOpenFileName instead and pass the resulting filename
chosen by the user to your subroutine.

Regards,
Martin Brown


Thanks for your reply. Maybe I'm not making myself clear here, because I
think this approach has the same problem. When I open the .NAB file, XL
_automatically_ begins the file conversion routine, first asking what type
of delimiter is being used, then continues with 2 other dialog boxes to
fill to define how to convert the file. I can't start, or stop, a macro
once this process begins until it is done. So I can't open the .NAB file,
then do anything except fill in the blanks telling XL how to do the
conversion. So I can't run the macro to pass the filename until that is
done. I can still run the routine to clean up the columns and create the
column headers afterwards, but I can't automate the conversion process
settings unless I can intervene when the .NAB file is opened and before the
auto conversion process begins. Does that make it any clearer? Does anyone
have any suggestions, or is this just not doable?


I have no idea about the internal structure of a .NAB file so this may
or may not be helpful. The way that I open structured text files with
VBA in Excel is

Workbooks.OpenText filename:=filename, _
Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, _
Tab:=True, Semicolon:=False, Comma:=True, Space:=False, Other:=False

Obviously you have to set the various parameters to whatever your
strange file requires and the conversion then proceeds automatically.

Regards,
Martin Brown


 
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
how do I email an excel file in Novel groupwise? JR Excel Discussion (Misc queries) 0 June 26th 07 01:50 PM
GroupWise integration raviadd Excel Programming 1 June 21st 05 07:16 PM
When I open a file, Excel goes to Groupwise Lib curtis182 Excel Discussion (Misc queries) 0 May 20th 05 07:24 PM
Help with Novell GroupWise. Jako[_12_] Excel Programming 0 May 11th 04 08:10 PM
VBA send mail with groupwise flo[_2_] Excel Programming 1 December 11th 03 03:10 PM


All times are GMT +1. The time now is 06:35 PM.

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"