Exporting Files: length of directory name

  • Thread starter Thread starter Joe Guenther
  • Start date Start date
J

Joe Guenther

I am currently trying to use the TransferSpreadsheet
action in a macro to export a table to an excel file. I
am getting a message: "Can't Update. Database or obejct
is read-only". I've determined that this message appears
when the target location exceeds a certain lenght
(approximately 50 characters). For example, the
following location works:
C:\NewTestDirectory\NewTestDirectorySub1\test.xls,
however this location doesn't:
C:\NewTestDirectory\NewTestDirectorySub1
\NewTestDirectorySub2\test.xls

I am running Access 97 in the Windows XP environment. My
company was previously on Windows NT, and this was not a
problem. Has anyone experienced this, and are there any
solutions?
 
Verify that the NewTestDirectorySub1 folder has the same Security/shared
permission settings as newTestDirectory and NewTestDirectorySub2.

Example: If XP Pro is used and hardrive was formatted NTFS check that
permissions are 'inherited'. In some cases you can remove a folder/directory
from inherited from parent. However, any new folder created under the root
will inherit the permissions.

If XP Home/Pro and FAT formatting was used. Check shared permissions against
the Sub1 verses the Sub2 folder.
 
Length of path/filename can be an obstacle in some exports. Did you set the
EXCEL version argument to the 9.0 or higher version number? If you use the
95 version format, this obstacle is usually observed commonly.

Otherwise, use VBA to export the file to a higher level folder (using
DoCmd.TransferSpreadsheet, and then use the
Name [original path and file name] As [[new path and file name]
command to move the file to your final place.
 
Back
Top