UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Concatenating File Name In Export Macro, Office 2010    
 
   
kobus-dippenaar
post Mar 2 2012, 05:59 AM
Post #1

UtterAccess Member
Posts: 23



Dear All
I Have a system running and I would like each user to export and import data via the import/export excel macro.
Currently the code is C:\SUBMIT FOLDER\SUBMITFILE.xls
I need to replace it with some code and a variable containg the user name.
I have seen on the web like ="\\Network_Path\& even a date & "File name.xls" I could not get it to work.
HELP please.

Blessings.
Go to the top of the page
 
+
arnelgp
post Mar 2 2012, 07:30 AM
Post #2

UtterAccess Ruler
Posts: 1,090



You must have a write right on the shared network path in order to save your file.
To get the current user, you can use the Environ("UserName") function.
Go to the top of the page
 
+
kobus-dippenaar
post Mar 2 2012, 07:45 AM
Post #3

UtterAccess Member
Posts: 23



Thanks. Get the user is not the problem. It is to user it as a variable in the Macro to export a table as a excel file.


The Macro Action is:OutputTo
The Output file is:C:\SUBMIT FOLDER\SUBMITFILE.xls

I need to substitute the [SUBMIT FOLDER] with a internal variable containg the user and a folder name.

My proble is can it be done in a macro? I do not get the systax right.

Blessings.
Go to the top of the page
 
+
kobus-dippenaar
post Mar 3 2012, 01:46 AM
Post #4

UtterAccess Member
Posts: 23



Yahooooo! Hallelujah!!!
I have solved my problem by using the VBA option in Access with the coding: DoCmd.TransferSpreadsheet ......
Blessings to all
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 25th May 2013 - 09:15 PM