Cameroncha
Registered User.
- Local time
- Today, 07:51
- Joined
- Jul 1, 2002
- Messages
- 58
because of a problem with access cutting off memo fields after 255 characters, a user in this group made this script for me to solve the problem.
I saved it as a module called Excel256_fix and then try to run it i get an error this says "compile error, cant find module or library"
I searched and people in group talk about OLE object libraries under TOOLS/References but it is always grayed out. I am running Access 2000.
*******************************
Option Compare Database
Option Explicit
Private Sub Command1_Click()
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open "C:\FilePath.xls"
xlApp.Cells(1, 1).Select
xlApp.Visible = True
Dim MLength As Integer
Dim LoopNum As Integer
Dim i As Integer
Dim MPart As String
MLength = Len(Contents)
LoopNum = MLength / 255
For i = 0 To LoopNum
If i = 0 Then
MPart = Left(Contents, 255)
Else
MPart = Mid(Contents, 255 * i, 255)
End If
xlApp.Cells(i + 1, 1) = MPart
End Sub
*******************************
I dont know whats going on because i dont understand VB too well. Help ?
I saved it as a module called Excel256_fix and then try to run it i get an error this says "compile error, cant find module or library"
I searched and people in group talk about OLE object libraries under TOOLS/References but it is always grayed out. I am running Access 2000.
*******************************
Option Compare Database
Option Explicit
Private Sub Command1_Click()
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open "C:\FilePath.xls"
xlApp.Cells(1, 1).Select
xlApp.Visible = True
Dim MLength As Integer
Dim LoopNum As Integer
Dim i As Integer
Dim MPart As String
MLength = Len(Contents)
LoopNum = MLength / 255
For i = 0 To LoopNum
If i = 0 Then
MPart = Left(Contents, 255)
Else
MPart = Mid(Contents, 255 * i, 255)
End If
xlApp.Cells(i + 1, 1) = MPart
End Sub
*******************************
I dont know whats going on because i dont understand VB too well. Help ?