Can't see my worksheet in excel

P

Pat Lenahan

Here's my code. When I run it, it doesn't show the worksheet opening and
viewing it. My code is in VB6 don't worry about the other stuff listed.

Thanks

Pat

Private Sub cmdprocess_Click()
Dim remove_selected As Integer
Dim SSQL As String
Dim mdlopt2 As New ADODB.Recordset
Dim stuff As String

'Dim col As Integer
'Dim row As Long


Dim Excel As Excel.Application
Dim ExcelWbk As Excel.Workbook
Dim NFRCWS As Excel.Worksheet
Set Excel = GetObject(, "Excel.application") 'Create excel object
Set ExcelWbk = Excel.Workbooks.Open("j:\nfrc.xls") 'open this workbook to
excel
Dim MyRange As Range
'Set MyRange = NFRCWS.Range("a65536").End(xlUp).Offset(1, 0)
Dim LASTROW As Integer

'Dim intloopindex As Integer
Dim ItemIndexes() As Long, x As Integer, iNumItems As Integer

Set NFRCWS = ExcelWbk.Worksheets(1) 'add this sheet to this workbook
ExcelWbk.Application.DisplayAlerts = True
'NFRCWS.Visible = xlSheetVisible
ExcelWbk.Application.Visible = True
NFRCWS.Visible = xlSheetVisible

mdlopt2.CursorType = adOpenKeyset
mdlopt2.LockType = adLockBatchOptimistic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top