Epplus - how to freeze the top row of a worksheet - freeze

Using EPPlus, freezing pane by using ws.View.FreezePanes(2, 1) will freeze the top row of the current displayed rows. When opening the file using excel programmatically how to make sure that it will be the first line of the spreadsheet that will be frozen?

Related

PowerPoint: Repeat text on every slide

I'm working on creating a PowerPoint template for daily class presentations. In the template I'd like to have a hunk of text that is prominently displayed on the first slide and which repeats at the bottom of the subsequent slides at the bottom in a smaller size. The text will change every day.
The ideas I've had so far:
Use a text field. As far as I can tell, PowerPoint doesn't have anything like a text field that can be dynamically set.
Use a footer - this works and I can modify the master to get the look I want, but I'd really like to be picking up the value of the text from the first page so that edits would be automatically applied and to save the initial step of setting the footer.
Using VBA - I'd be willing to give this a shot, but I've never used VBA and the learning curve seems steep so it would be nice to know if the idea is feasible in VBA.
Can this be done? How would you approach it?
Here's an example of what I'm hoping to be able to do. Ideally the solution would work on both the Mac (2013) and Windows (2016) version of PowerPoint.
You can connect your presentation with an excel file. And running the code in the ppt would pull out the text in the excel file and update the titles instantly.
Create a presentation with a textbox with some temporary text. Put the below code in ppt. save as pptm.
Sub AddMotionPath()
Dim Temp As String
Excel.Application.Workbooks.Open ("D:\Users\Desktop\Book1.xlsx") ' update the path of the excel file
Workbooks("Book1.xlsx").Activate 'activate the file
For p = 1 To 4
Temp = Workbooks("Book1.xlsx").Worksheets("Sheet1").Range("B" & p + 1).Value ' Column B has the titles
ActivePresentation.Slides(p).Shapes(1).TextFrame.TextRange.Text = Temp ' this updates the titles from excel to ppt slide
Next
Excel.Application.Workbooks("Book1.xlsx").Close False 'closes the excel file
End Sub
Let me know if this works for you. You can update the excel file and run the macro in ppt. The text in the slides will be updated automatically.

How to use macros for hyperlink in Excel

I have sharpoint site where I have uploaded the Excel.
I have few list each list have same excel hyper link..
What I want to perform..
In Excel I have some data, Onclick of first hyperlink I want to open same excel sheet but I want some row to be selected.
same I want when I click on other option it should open same excel but row should be different one slected.
I tried to acheive this using the Macros but not able kno, How i will configure for hperlink..
https://support.office.com/en-us/article/Quick-start-Create-a-macro-455512ef-3532-404e-b8dd-ea6589512c1b

Autoformat Excel worksheet Name VBA MS Access 2013

I am trying to autoformat how the bottom of an Excel page appears in order to automatically view the whole worksheet name. By default, half of the worksheet name is cut off because the horizontal scrollbar near the bottom of the page is too large. By dragging it over I can then view the entire worksheet name.
Instead of having to go into excel and doing this manually, is there a way to do this in VBA? I am using MS Access to export data to these excel files.
You can set the scroll bar width using the TabRatio property of the Window object. The values are between 0 and 1 and the larger the value, the smaller the scrollbar width. For example:
xlApp.Activewindow.Tabratio = 0.9

Excel sheet Deletes the formulas present in the sheet when I open it. How to avoid this?

I'm uploading an excel file that contains sheets, to my server which encodes to base 64 so I decode it as required and process it by adding data in sheet 5 as column1 and column2 with certain number of rows. At the time of uploading, this sheet has some specific formulas on sheet 5 that makes changes in other sheets. So on opening the file which I send as response after editing from server, There comes this prompt that reads
"Excel Found unreadable content in 'MyDownloadedExcelData.xlsx'. Do you want to recover the contents of this workbook?If you trust the source of this workbook, click Yes', with Yes and no buttons
and when I click on yes and open the sheet, all the formulas are deleted.
I see something like
Excel was able to open the file by repairing ot removing the unreadable content.
Removed Records :Formula from /xl/calcChain.xml Part
Repaired Records : Cell Information from /xl/worksheets/sheet1.xml part etc
So, How do I make sure my formulas in the sheet are retained?
Using VBA you could have an on close event that pastes values and an on open event that recreates the formulas. Your file would essentially save with static data, but then be used with functions intact.
If this solution is of interest I can help provide some coding framework.

VBA code on Hidden Sheet

I am building a small piece of VBA code to update the pivot table automatically so that my chart gets updated. After recording the code, I created stored it in the vb script of the sheet.
Here is my code:
ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh
I do not want to show the sheet containing the pivot table. So I hide the sheet, and then the code fails to work.
Try changing ActiveSheet to Worksheets("WorksheetName")
So you'd have
Worksheets("WorksheetName").PivotTables("PivotTable2").PivotCache.Refresh
Using ActiveSheet means it performs it on the sheet that is currently selected, last I checked you can't have a hidden sheet selected ;)