LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Error only without references

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
EXCEL ERROR: This workbook contains INVALID references. ? Boswell[_2_] Excel Discussion (Misc queries) 0 February 27th 10 02:28 AM
Formula with Invalid References Error Message DOUG Excel Discussion (Misc queries) 5 August 17th 09 07:13 PM
Ignore error msgs in formula references gharden Excel Discussion (Misc queries) 4 June 17th 05 12:14 AM
Error only without references JJZ[_3_] Excel Programming 3 October 4th 04 11:03 AM
Missing Word 10 Object Error References Rajan Excel Programming 1 July 23rd 03 02:12 PM


All times are GMT +1. The time now is 10:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"