It's Excel 2007 and also Access 2007. But I've noticed that on the computer where it didn't work excel is opened in compatibility mode. No idea why but this should explain why it crashes at the 257th column.:rolleyes:
In sub pr_Additional_Table()
...
If RowNr = 2 Then
For i = 0 To rstAdd.Fields.Count - 1
xlWks.Cells(1, ColNr + i + 1) = rstAdd.Fields(i).Name
Next i
End If
...
The moment when ColNr + i + 1 equals 257.
I'm writing to an excel file from two separate Access tables, for which I'm using two separate DAO.Recordsets in VBA.
The first table has 190 columns, the second table has more than 66 columns, so more than 256 columns will be written to the excel file.
So I'm not expecting any error due to any...
I'm opening another access database using the following code:
Private Sub OpenTargetDB()
Set accapp = New Access.Application
accapp.OpenCurrentDatabase (TargetDBName)
'accapp.Visible = True
End Sub
Private Sub CloseTargetDB()
'accapp.Visible = False
accapp.CloseCurrentDatabase
Set accapp =...
My file looked like this in hex edit mode:
I usually start with FileSystemObject.OpenTextFile and ReadLine, but for some reason this just didn't work here.
I'm using VBA in order to read through a file byte by byte.
Ultimately I want to remove some invalid characters from a textfile.
Option Compare Database
Option Explicit
Sub TestFunction()
MsgBox "fn_ReadWriteStream started"
If fn_ReadWriteStream("C:\Project\Utilities\Access en...
This is accomplished by the following VBA code:
Option Compare Database
Option Explicit
Sub TestFunction()
MsgBox "fn_ReadWriteStream started"
If fn_ReadWriteStream("C:\Project\Utilities\Access en VB\Macro2SQLtext\Macro_mcr_all_qry.txt") = True Then
MsgBox "fn_ReadWriteStream...
After this some other VBA would parse the exported macro-code, and ultimately make a nice report of all queries executed from the specified macro. This whole thing worked nicely until now that I run it from one DB targeting a different DB.
Looks like I could use some VBA code that could remove...
I'm doing the following in VBA:
Open another database:
Private Sub OpenTargetDB()
Set accapp = New Access.Application
accapp.OpenCurrentDatabase (TargetDBName)
'accapp.Visible = True
End Sub
Then pick some macro from the other target database and export it to a textfile:
Dim i As Integer
Dim...
I'm calling an Access macro from a bat file using the following code:
start /wait msaccess C:\MyAccessFiles\myaccessfile.mdb /x:mymacro
The macro doesn't do anything except for running a VBA function.
Is it possible to pass on some parameters from the bat file to the macro and ultimately to the...
Maybe I've got it:
Function Tomorrow_9() As Date
Dim hDate As Date
Dim h9 As Date
h9 = #9:00:00 AM#
hDate = DateAdd("d", 1, Now())
hDate = CDate(Format(hDate, "dd/mm/yy"))
Tomorrow_9 = DateAdd("h", 9, hDate)
End Function
How can I get Tomorrow 9:00:00 AM in a Date type?
Following code will return exactly current time tomorrow:
Dim hDate As Date
hDate = DateAdd("d", 1, Now())
But I want tomorrow 9:00:00 AM in hDate.
I've found something new in some other persons excelsheet - see attached image.
Does anyone know what it is exactly and how to make it?
Thanks in advance.
Hi
I used to go to menu Help --> About <whatever app> to view version details of whatever app I was using.
I can't find this in Access 2007.
I know I'm using Access 2007 but I'd like to check if there's any sub-version.