Registering excel - code to define columns automatically

29 views
Skip to first unread message

Matthew Hirsch

unread,
Sep 16, 2021, 4:00:43 PM9/16/21
to mapi...@googlegroups.com

Is it possible to code the “Register Table” command with specific column formatting rather than having to do so manually?

 

Using this command,

 

Register Table "M:\Pulls\Set.xlsx"  TYPE XLS Titles  Range "ExternalData_1"  Interactive Into "M:\Pulls\Set.TAB"

 

has the table structure window appear so the user can select column formats.

 

I’d like to code in the column formats so that is skipped, if possible.

 

Thank you.

 

Peter Horsbøll Møller

unread,
Sep 17, 2021, 1:23:53 AM9/17/21
to mapi...@googlegroups.com

Hi Matthew

 

Have you tried omitting the Interactive keyword from your statement?

 

From the help:

Specifying the Interactive keyword for the XLS type, instructs the interface to display the Set Field Properties window when importing Excel files.

 

MapInfo Pro will inspect the data and come up with the best match.

If you want to change this, you could open the tab file created using the Register Table statement, and change the column types defined here.

By open I mean, open it as a file through MapBasic and writing out a new file with the changed column types.

 

This would of course require that you know which column types to change

 

Peter Horsbøll Møller

www.precisely.com

 

Peter Horsbøll Møller
Principal Sales Engineer - Distinguished Engineer

 

From: mapi...@googlegroups.com <mapi...@googlegroups.com> On Behalf Of Matthew Hirsch
Sent: 16. september 2021 22:01
To: mapi...@googlegroups.com
Subject: [MI-L] Registering excel - code to define columns automatically

 

This message originated Externally. Use proper judgement and caution with attachments, links, or responses.

 

--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/SJ0PR04MB7501218FDC83C9790A1A0308ABDC9%40SJ0PR04MB7501.namprd04.prod.outlook.com.

Reply all
Reply to author
Forward
0 new messages