ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cells().value is null but I can see data (https://www.excelbanter.com/excel-programming/287150-cells-value-null-but-i-can-see-data.html)

JohnEnnever

Cells().value is null but I can see data
 
I am extracting data from a Excel sheet. It looks like a special form.

When I retrieve

Cells(row,col).value

I can get the Captions on the sheet but not the data in other cells.

I can see the data - I can see which cell it is in - How do I get hol
of it ?

I found this in one of the modules - is this how the data is hidden?

Public Declare Function FindFirstFile Lib "kernel32" Alia
"FindFirstFileA" _
(ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) A
Long

Public Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * 260
cAlternate As String * 14
End Type

Private Sub ShowFileInfo()
' This subroutine demonstrates the technique
Dim hFile As Long
Dim WFD As WIN32_FIND_DATA
Dim FullName As String
Dim Created As String
Dim LastWrite As String

' FullName is the path and filename
' Substitute any valid file and path
FullName = ActiveWorkbook.FullName
hFile = FindFirstFile(FullName, WFD)

If hFile 0 Then
Created = FileDate(WFD.ftCreationTime)
MsgBox "File Created: " & Created, vbInformation, FullName
Else
MsgBox "File not found.", vbCritical, FullName
End If
End Su

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Cells().value is null but I can see data
 
That code gets information about a file.

It is unclear what a caption on the sheet is versus data in cells.

--
Regards,
Tom Ogilvy


JohnEnnever wrote in message
...
I am extracting data from a Excel sheet. It looks like a special form.

When I retrieve

Cells(row,col).value

I can get the Captions on the sheet but not the data in other cells.

I can see the data - I can see which cell it is in - How do I get hold
of it ?

I found this in one of the modules - is this how the data is hidden?

Public Declare Function FindFirstFile Lib "kernel32" Alias
"FindFirstFileA" _
(ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As
Long

Public Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * 260
cAlternate As String * 14
End Type

Private Sub ShowFileInfo()
' This subroutine demonstrates the technique
Dim hFile As Long
Dim WFD As WIN32_FIND_DATA
Dim FullName As String
Dim Created As String
Dim LastWrite As String

' FullName is the path and filename
' Substitute any valid file and path
FullName = ActiveWorkbook.FullName
hFile = FindFirstFile(FullName, WFD)

If hFile 0 Then
Created = FileDate(WFD.ftCreationTime)
MsgBox "File Created: " & Created, vbInformation, FullName
Else
MsgBox "File not found.", vbCritical, FullName
End If
End Sub


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com