Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am writing a CSharp program that creates an excel file. Now, I want to
hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought this would work, but the columns are still visible in my output file.
((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden = true; "VenuV" wrote: I am writing a CSharp program that creates an excel file. Now, I want to hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This last one ( ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden =
true; ) should have worked. - You are sure that ((Excel.Range)(oSheet.Cells[1, col])) is pointing to the right book, sheet, range? - And can you check the value of ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden just after you set it to true ? -- Regards, Sébastien <http://www.ondemandanalysis.com "VenuV" wrote: I thought this would work, but the columns are still visible in my output file. ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden = true; "VenuV" wrote: I am writing a CSharp program that creates an excel file. Now, I want to hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I checked the value it gives an exception when I try to find the value
<error: an exception of type: {System.ArgumentException} occurred Maybe it is looking for an assignment. "sebastienm" wrote: This last one ( ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden = true; ) should have worked. - You are sure that ((Excel.Range)(oSheet.Cells[1, col])) is pointing to the right book, sheet, range? - And can you check the value of ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden just after you set it to true ? -- Regards, Sébastien <http://www.ondemandanalysis.com "VenuV" wrote: I thought this would work, but the columns are still visible in my output file. ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden = true; "VenuV" wrote: I am writing a CSharp program that creates an excel file. Now, I want to hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, but i am running out of idea.
-- Regards, Sébastien <http://www.ondemandanalysis.com "VenuV" wrote: I checked the value it gives an exception when I try to find the value <error: an exception of type: {System.ArgumentException} occurred Maybe it is looking for an assignment. "sebastienm" wrote: This last one ( ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden = true; ) should have worked. - You are sure that ((Excel.Range)(oSheet.Cells[1, col])) is pointing to the right book, sheet, range? - And can you check the value of ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden just after you set it to true ? -- Regards, Sébastien <http://www.ondemandanalysis.com "VenuV" wrote: I thought this would work, but the columns are still visible in my output file. ((Excel.Range)(oSheet.Cells[1, col])).EntireColumn.Hidden = true; "VenuV" wrote: I am writing a CSharp program that creates an excel file. Now, I want to hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I don't know CSharp, but the syntax of the COlumns seems weird: can you do something like: Columns[col] or Columns[ ,col] or Columns[ <missing ,col] ? -- Regards, Sébastien <http://www.ondemandanalysis.com "VenuV" wrote: I am writing a CSharp program that creates an excel file. Now, I want to hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I tried Columns[1, col] and it gives me a numbered exception - Exception from HRESULT: 0x800A03EC The other options you suggested give syntax errors. "sebastienm" wrote: Hi, I don't know CSharp, but the syntax of the COlumns seems weird: can you do something like: Columns[col] or Columns[ ,col] or Columns[ <missing ,col] ? -- Regards, Sébastien <http://www.ondemandanalysis.com "VenuV" wrote: I am writing a CSharp program that creates an excel file. Now, I want to hide/show certain columns after the excel file has been created. I am using the Application object model and worksheet object. My Vstudio doesn't give me any options to access the column hide/show features and in fact. I tried various ways including this, which won't work. ((Excel.Range)(oSheet.Columns[0,col])).EntireColumn.Hidden = true; Please advise. Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I conditionally hide or show a column in Excel | Excel Discussion (Misc queries) | |||
Hide column and show only in row in use | Excel Discussion (Misc queries) | |||
Show/Hide Column and Row Headers | Excel Discussion (Misc queries) | |||
hide column but show chart | Charts and Charting in Excel | |||
Macro for Show/Hide Column | Excel Discussion (Misc queries) |