Saving workspace

332 views
Skip to first unread message

TinaA...@gmail.com

unread,
Dec 5, 2006, 11:08:31 AM12/5/06
to MapInfo-L
Using MapInfo 7.0 or 8.5, I am trying to save a workspace but I get an
error. The error that I receive is "Unable to save workspace".

I am running a MapBasic command to save the workspace. The command I
am running is: Save Workspace As "MAP.WOR"

Once the user receives the error, they are able to go to the File menu
and select the option to save the workspace. They can do this without
any errors.

My users requested an option to save all tables and the workspace in
one step. There were running into too many instances where they would
forget to save the workspace when they were making changes. Is there a
better way to save the workspace? Does anyone see anything wrong with
the save workspace command.

Thanks in advance for any help you can provide on this.
Tina Allsup ~ Programmer Analyst for YellowBook

Bob Young

unread,
Dec 5, 2006, 11:26:07 AM12/5/06
to mapi...@googlegroups.com
Hi Tina

Perhaps your user does not have write permission to the default folder.

You can also run the save workspace command from the MapBasic Window.
Perhaps its worth trying setting a path with known write permissions eg

in MapBasic WIndow get user to type in Save Workspace as
"c:\writeable\map.wor"

HTH

Bob

Bill Thoen

unread,
Dec 5, 2006, 11:34:25 AM12/5/06
to mapi...@googlegroups.com
On Tue, Dec 05, 2006 at 04:08:31PM -0000, TinaA...@gmail.com wrote:
>
> Using MapInfo 7.0 or 8.5, I am trying to save a workspace but I get an
> error. The error that I receive is "Unable to save workspace".
>
> I am running a MapBasic command to save the workspace. The command I
> am running is: Save Workspace As "MAP.WOR"
>
> Once the user receives the error, they are able to go to the File menu
> and select the option to save the workspace. They can do this without
> any errors.
>
> My users requested an option to save all tables and the workspace in
> one step. There were running into too many instances where they would
> forget to save the workspace when they were making changes. Is there a
> better way to save the workspace? Does anyone see anything wrong with
> the save workspace command.

Tina,

I think you need to include the full path in the workspace filename and
also make sure that your user has write permission in that directory.

In addition, if the workspace is larger than 32K you might have to save it
with the Run Command statement, like so:

Run Command "Save Workspace As " + HomeDirectory$()+"MAP.WOR"

Also, here's some notes about saving selections and thematic maps in
workspaces that I got from MI Tech Support a while ago:

> ++++++++++++++++++++
> Discussion:
> Normally, saving a thematic map is no problem. You just have to save the
> whole workspace.
> But: whenever you draw a thematic map based on a selection, save it into a
> workspace and close that workspace, a problem arises: if you open the
> workspace again, both the selection and the thematic map are lost.
>
> What is done against this bug?
>
> Conclusion:
> Selections aren't saved in workspaces. If you created the selection
> through Query>SQL Select or Query>Selection, you could choose File>Save
> Query As to save the query. Then, perform the thematic on this query
> table and save the workspace. The workspace will then be re-created.
> Otherwise, save a copy of the query as a new table. Open the copy of the
> query and create the thematic on this copy. Then, save the workspace.
> The workspace will be re-created properly when opened. This really isn't
> a bug but the way MapInfo was designed.
> ++++++++++++++++++++
>
> +++++++++++++++++
>
> Discussion:
> What do workspaces save?
>
> Conclusion:
>
> Workspaces save the appearance of the desktop (e.g.,. what windows are
> currently open, size and position of windows) and thematic shading.
> Workspaces also save labels.
>
> To activate the Save Query option when using a workspace, you must
> activate the Save Queries in Workspaces option in the Startup preferences
> dialog:
>
> **Queries on queries will not be saved in the workspace.
>
> 1. Choose Options > Preferences > Startup. The Startup Preferences dialog
> displays.
> 2. Check the Save Queries in Workspaces option (default setting).
> 3. Click OK.
>
> If you selected this option and open a workspace, the associated queries
> are regenerated. A separate MapInfo table (.tab) file for the queries is
> not created.
>
> Version 3x/4x:
> Workspaces do not, save temporary tables (queries, selections) or
> anything that is based on temporary tables (thematic shading, etc.).

Bob Young

unread,
Dec 5, 2006, 11:36:03 AM12/5/06
to mapi...@googlegroups.com
Hi Tina

I can recreate this by setting read only on the workspace file.

So has someone perhaps set readonly flag on an existing file called map.wor?

Bob


----- Original Message -----
From: <TinaA...@gmail.com>
To: "MapInfo-L" <mapi...@googlegroups.com>
Sent: Tuesday, December 05, 2006 4:08 PM
Subject: [MI-L] Saving workspace


>

TinaA...@gmail.com

unread,
Dec 5, 2006, 12:08:08 PM12/5/06
to MapInfo-L
Bill

I believe you are on the correct path here. I just verified that the
workspace is 134K in size. Therefore I will have to save it with the
Run Command. But I have a question in how to determine the correct
directory name to use. The maps are not all saved in the same
location. Each map has a unique directory name.

Is there a a way to determine the directory name to use in the save
command? The users may open the map from double clicking on the
map.wor file from Windows Explorer or by opening Map Info and selecting
to open a workspace (they are then required to find the correct folder
information that way).

Thanks

Bill Thoen

unread,
Dec 5, 2006, 1:16:36 PM12/5/06
to mapi...@googlegroups.com
The only way I know to get the original location of the workspace is to
write an mbx that also launches the workspace and make people open it that
way (use the FileOpenDlg() function). Or you could have them pick a
location by using the FileSaveAsDlg() function. MapInfo carries this info
internally, but you can't get to it via MBX.

David Reid

unread,
Dec 5, 2006, 1:55:11 PM12/5/06
to mapi...@googlegroups.com, Bill Thoen
So, is it advisable to get into the habit of using the "Run Command" method
of saving ANY workspace in all code written which might include such an
action?

Dave


Tina,


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.6/567 - Release Date: 12/4/2006
7:18 AM

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.9/573 - Release Date: 12/5/2006
4:07 PM

Bill Thoen

unread,
Dec 5, 2006, 2:19:19 PM12/5/06
to mapi...@googlegroups.com
On Tue, Dec 05, 2006 at 12:55:11PM -0600, David Reid wrote:
> So, is it advisable to get into the habit of using the "Run Command" method
> of saving ANY workspace in all code written which might include such an
> action?

That's what I do now in all MBX code that needs to save a workspace. Run
Command "Save Workspace ..." works in more cases than just plain "Save
Workspace..." and I don't know that there's any downside to doing it this
way.

- Bill Thoen

Peter Horsbøll Møller

unread,
Dec 5, 2006, 2:34:46 PM12/5/06
to mapi...@googlegroups.com
Tina,

This is a known problem. In certain cases the Save workspace will fail from within MapBasic.

You can get around this problem by using the Run Command to use "MapInfo" to save the workspace.

In you MapBasic application you write:

Run Command "Save Workspace As " & Chr$(34) & "Map.WOR" & Chr$(34)

in stead of

Save Workspace As "Map.WOR"

HTH
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT

COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark

Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail p...@cowi.dk
http://www.cowi.dk/gis

-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of TinaA...@gmail.com
Sent: Tuesday, December 05, 2006 5:09 PM
To: MapInfo-L
Subject: [MI-L] Saving workspace


Using MapInfo 7.0 or 8.5, I am trying to save a workspace but I get an error. The error that I receive is "Unable to save workspace".

I am running a MapBasic command to save the workspace. The command I am running is: Save Workspace As "MAP.WOR"

Once the user receives the error, they are able to go to the File menu and select the option to save the workspace. They can do this without any errors.

My users requested an option to save all tables and the workspace in one step. There were running into too many instances where they would forget to save the workspace when they were making changes. Is there a better way to save the workspace? Does anyone see anything wrong with the save workspace command.

Thanks in advance for any help you can provide on this.

Reply all
Reply to author
Forward
0 new messages