I looked at my emails again and it appears as though the report is running twice. They have different time stamps in the Report headers.
What I have is a task that I have scheduled on Mondays at 0745.
It
1) opens up MS Access
2) opens up database
3) opens a form
4) quits Access.
The...
On form open I have code that I want to send a report as an email attachment each time the form is opened. The below code runs correctly and builds the email and attachment only it sends duplicate copy of the email each time I run it.
Please help!!!
Ann
Private Sub Form_Load()
Dim...
With XP my code writes to C:\ without a problem.
When I attempt to write to this folder using Win 7 it fails. I have attempted to capture environment variable info and point to user's temp folder as a test and it does not work either. For example:
C:\Users\Ann\AppData\Local\Temp
for the user...
OK, thank you both. I probably need to post a new thread but...
My user community has begun to upgrade their systems from XP to Win 7. Any ideas on why users with Windows 7 are unable to write to C:\ from my Access VBA code even with local admin rights and full control permissions set?
Thanks, Andy, but the following generates a permission denied error message.
On Error GoTo ErrorHandler
Kill "C:\ALL_CAPSpreadsheet.xls"
I would like to have the ErrorHandler take control and display the message instead of the end user receiving the Permission Denied message.
I have...
Sorry, if I was not clear, if I run the code a second time without exiting Excel, I recieve an error.
Runtime error 90 permission denied. It bombs when it attempts to kill the excel file.
An error is received when I run the following code if I do not exit MS Access after running it. The code runs a query, exports results to an Excel file and formats the worksheets. If I exit Access each time it runs fine. I have a command button on a form that executes the code.
Any...
Function OpenAndFormatExcel()
Dim filePath As String
Dim xl As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
filePath = "c:\CAPSpreadsheet.xls"
Set xlBook = xl.Open(filePath)
xl.Visible = True
For Each X1Sheet In Worksheets...
I have posted my code below. I am taking a stab at updating header in each sheet. Only the first row header in the first sheet is updated. Can you help with my bug. thanks.
Private Sub Command1_Click()
Dim site_counter As Integer
Dim SOutput As String
'If Dir(SOutput) <> "" Then Kill...
Thanks for your feedback.
My first attempt to record a macro in excel earlier today failed.
I assume I should be able to generate Access VBA code to:
1) export the data to the worksheets using the code I posted earlier
2) copy and paste the excel code produced by recording the macro into...
I have a MS access database and am able to export the data to a single excel file with multiple worksheets. Each worksheet is labeled with a site name. When I export the data, I would like to be able to format the data in VBA code or export to a template.
I run the code from a command button...
I am collecting the Active Directory user name using Environ and am able to keep a subset of user from updating data in the main form but not a sub form.
Anyone have any hints.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.