Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Refrencing Excel cells on a Excel file on a NAS with VBA

I am getting Excel file names from a user, and I want to take the array of
file names and get the same range of cells on each file using the file name.
The files are on a NAS. I can do this in Excel by opening both file and in
the cells I want hitting "=" then clicking on the file and the cells I want.
I would like to automate this, but when I parse the string to the right
syntax and it just puts it in the cell as a string. I try the .value and
..formula but that returns an type mismatch error.

I sorry for the long message, I am new at this
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Refrencing Excel cells on a Excel file on a NAS with VBA

Post the code you are trying to use.


"Jacob" wrote in message
...
I am getting Excel file names from a user, and I want to take the array of
file names and get the same range of cells on each file using the file
name.
The files are on a NAS. I can do this in Excel by opening both file and in
the cells I want hitting "=" then clicking on the file and the cells I
want.
I would like to automate this, but when I parse the string to the right
syntax and it just puts it in the cell as a string. I try the .value and
.formula but that returns an type mismatch error.

I sorry for the long message, I am new at this



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Refrencing Excel cells on a Excel file on a NAS with VBA

Hi there

I have written a program which is shareware and which could solve the
problem. You can define names in every single workbook and
the program collects the data over the names in one many workbooks and
creates a list in a new workbook. Then you could record a macro and directly
copy/paste the code in
the program so it will be excecuted every time you start the report. The
program is in German but I can help you with that. Unfortunately the program
is not free of charge but has a 30 day evaluation period.

Download-Link: http://www.excelspezialist.ch/index....v=400&text=430

Kind regards,

Alex
------------------------------------
Excel-Spezialist
www.excelspezialist.ch
------------------------------------


"Jacob" schrieb im Newsbeitrag
...
I am getting Excel file names from a user, and I want to take the array of
file names and get the same range of cells on each file using the file
name.
The files are on a NAS. I can do this in Excel by opening both file and in
the cells I want hitting "=" then clicking on the file and the cells I
want.
I would like to automate this, but when I parse the string to the right
syntax and it just puts it in the cell as a string. I try the .value and
.formula but that returns an type mismatch error.

I sorry for the long message, I am new at this


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Refrencing Excel cells on a Excel file on a NAS with VBA

Lets say the files the user selects are from N:\Reports\Daily


Code:
Sub button2click()
'This macro gets the file names of the daily reports files
'chage files to same directory and then parce the string to file name
Dim Filt As String
Dim FilterIndex As Integer
Dim fileName As Variant
Dim Title As String
Dim i As Integer
Dim Msg As String
Dim add As String
Dim t As Integer

t = 0

Flit = "Text Files (*.txt), *.txt" & _
        "Excel Files (.xlsx), *.xlsx" & _
        "All Files (*.*), *.*"

FilterIndex = 5

Title = "Select a File to Import"

fileName = Application.GetOpenFilename(Filt, FilterIndex, Title, , True)

If Not IsArray(fileName) Then
    MsgBox "No files were selcted."
    Exit Sub
End If

For i = LBound(fileName) To UBound(fileName)
    Msg = Msg & fileName(i) & vbCrLf
    t = t + 1
    Next i
MsgBox "You selected:" & vbCrLf & Msg

For j = LBound(fileName) To UBound(fileName)
    Worksheets("Sheet1").Cells(j + 1, 2).Value = fileName(j)
    Next
    
'MsgBox (add)
MsgBox ("files selected are -" & t)


End Sub
I would like use the file names to reference values in cells in those files
that the user selected to get the file names. I was thinking of save copying
these files into a worksheet object

Code:
Dim wrksht As Worksheet
Dim objList As ListObject
   
Set wrksht = ActiveWorkbook.Worksheets("fileName(1)")
Set objList = wrksht.ListObjects(1)
objList.Range.Activate
but fileName(1) will not work, I think because it is using a string. Any
suggestions?

"JLGWhiz" wrote:

Post the code you are trying to use.


"Jacob" wrote in message
...
I am getting Excel file names from a user, and I want to take the array of
file names and get the same range of cells on each file using the file
name.
The files are on a NAS. I can do this in Excel by opening both file and in
the cells I want hitting "=" then clicking on the file and the cells I
want.
I would like to automate this, but when I parse the string to the right
syntax and it just puts it in the cell as a string. I try the .value and
.formula but that returns an type mismatch error.

I sorry for the long message, I am new at this




Reply
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
How to Export datas from Excel cells to another excel/dbase file viraj Excel Discussion (Misc queries) 2 June 11th 07 10:55 PM
Refrencing Diffrent Tab. Ardy Excel Programming 1 January 10th 07 05:20 AM
Refrencing Diffrent Tab. Ardy Excel Programming 1 January 10th 07 03:25 AM
Refrencing John Smith[_18_] Excel Programming 4 January 31st 06 03:01 PM
Refrencing cells using old Paste link method HELP! Rob Excel Programming 2 November 22nd 04 05:25 PM


All times are GMT +1. The time now is 05:42 PM.

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

About Us

"It's about Microsoft Excel"