Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I'm using VB6 and I created a project (EXE-file) to test this code. With the project - references - excel library turned on, this code runs just fine, but without it on, I get Error 1004. Dim xlapp As Object Private Sub Form_Load() If xlapp Is Nothing Then Set xlapp = CreateObject("Excel.Application") Else Set xlapp = GetObject(, "Excel.Application") End If xlapp.Visible = True excelfile = "c:\filename.xls" xlapp.workbooks.Open FileName:=excelfile, ReadOnly:=True If xlapp.ActiveWorkbook.ReadOnly = True Then xlapp.ActiveWorkbook.ChangeFileAccess xlReadWrite Else xlapp.ActiveWorkbook.ChangeFileAccess xlReadOnly End If End Sub does anyone know how to tackle this problem? Kind regards, JJ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
am i missing something? why would you want the excel library turned off? -----Original Message----- Hello, I'm using VB6 and I created a project (EXE-file) to test this code. With the project - references - excel library turned on, this code runs just fine, but without it on, I get Error 1004. Dim xlapp As Object Private Sub Form_Load() If xlapp Is Nothing Then Set xlapp = CreateObject("Excel.Application") Else Set xlapp = GetObject(, "Excel.Application") End If xlapp.Visible = True excelfile = "c:\filename.xls" xlapp.workbooks.Open FileName:=excelfile, ReadOnly:=True If xlapp.ActiveWorkbook.ReadOnly = True Then xlapp.ActiveWorkbook.ChangeFileAccess xlReadWrite Else xlapp.ActiveWorkbook.ChangeFileAccess xlReadOnly End If End Sub does anyone know how to tackle this problem? Kind regards, JJ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I created a program in VB6 that I have to send to customers. It runs
best without early bindings. Kind regards, JJ wrote in message ... hi, am i missing something? why would you want the excel library turned off? -----Original Message----- Hello, I'm using VB6 and I created a project (EXE-file) to test this code. With the project - references - excel library turned on, this code runs just fine, but without it on, I get Error 1004. Dim xlapp As Object Private Sub Form_Load() If xlapp Is Nothing Then Set xlapp = CreateObject("Excel.Application") Else Set xlapp = GetObject(, "Excel.Application") End If xlapp.Visible = True excelfile = "c:\filename.xls" xlapp.workbooks.Open FileName:=excelfile, ReadOnly:=True If xlapp.ActiveWorkbook.ReadOnly = True Then xlapp.ActiveWorkbook.ChangeFileAccess xlReadWrite Else xlapp.ActiveWorkbook.ChangeFileAccess xlReadOnly End If End Sub does anyone know how to tackle this problem? Kind regards, JJ . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I heart that it's illegal to send libraries with setup files, that's
why I have to use late bindings |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
EXCEL ERROR: This workbook contains INVALID references. ? | Excel Discussion (Misc queries) | |||
Formula with Invalid References Error Message | Excel Discussion (Misc queries) | |||
Error when Formula references a pivot table in an external workboo | Excel Discussion (Misc queries) | |||
Ignore error msgs in formula references | Excel Discussion (Misc queries) | |||
Missing Word 10 Object Error References | Excel Programming |