very easy, as ever.
1) I need to capture the excel tab name in a certain macro. I have tried stuff like.. x = sheets("sheet1").name and other stuff, but nothing works. What is the correct command , please. 2) I would like to capture the (approx) excel file size, that one can see under File, Properties, General. What is the correct command for this too, please. airhead |
sheets("sheet1").select
that will select it - not sure what you mean by capture? |
Code:
Dim exApp As New Excel.Application |
just tried..
x = ActiveSheet.Name ..which works, but I thought I tried that at work, oh well. still wouldn't mind the answer to the memory question if anyone knows. When I said 'capture', I just want to let the variable (eg var x) equal the desired 'value/name', so that I can do something with the 'captured' value/name. I'm just creating a 'lazy mans macro' that records info from large excel files (25-30mb, yes 3 of them) and pastes into a new workbook. When you have 200 records, the tab name helps id problems. It certainly beats recording the info by hand, or constantly toggling between sheets ! airhead [Edited by airhead - 11/22/2001 8:20:56 PM] |
Airhead,
In reply to your second question, use the command FILELEN(pathname). This returns a long amount in bytes of the file. e.g. Dim lFileLength as long lFileLength = FILELEN(c:\winnt\win.ini) Martin. |
My code works because I used it a couple o days ago to import stuff from an excel sheet.....
sheetName = exApp.Workbooks(1).Worksheets(1).Name the sheet number is in the Worksheets collection......you just have to iterate this collection and get the name of the sheet you want..... if you want a sample application lemme know.... |
All times are GMT +1. The time now is 02:01 PM. |
© 2024 MH Sub I, LLC dba Internet Brands