User Profile
Collapse
-
Works like a charm! Thanks!... -
-
Pasted your code with the following in a new module and it worked:
Code:Private Declare Function lopen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long Private Declare Function GetLastError Lib "kernel32" () As Long Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
Leave a comment:
-
[QUOTE=JConsulti ng]you're doing everything right...can you capture the error?
Won't let me...seems to get here
Open strFile For Input Lock Read As intFile
and get stuck and will go no further, won't execute the "on error" code at all; tried turning off warnings and still won't execute next line of code.Leave a comment:
-
Insert Rows into an Excel Spreadsheet from Access using VB
I would like to open an existing workbook, select a work sheet and insert multiple rows at the top of the spreadsheet. Have the following code, but unsure of proper command & syntax for Insert row, and how to make it insert at row A1.
Code:With DataSheet .Sheets(2).Select .Rows.Insert .Cells(1, 1).Value = txtLine1 .Cells(2, 1).Value =
-
Pasted your code in a Module.
Running code from a form, on click, right now just asking to display status
MsgBox fFileOpen(fname ) ' where fname includes path & filename
Is that what you were asking?...Leave a comment:
-
[JConsulting]
When I run code, I get a Run Time error '70'; Permission denied when I actually have a file open on code line which reads:
Open strFile For Input Lock Read As intFile
For some reason, won't "resume" as code tells it to on error. Odd
About the close part, only I have the file open so it is my file.Leave a comment:
-
Check if Workbook is open and close if it is
Looking for VBscript that will check to see if a specific Excel work book is open, by passing a variable name to check for which is the full file name with path. If it is open, it closes it.
No activity results to display
Show More
Leave a comment: