Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Go Back  Xtreme Visual Basic Talk > > > Modifying Excel sheet using VB.net before importing


Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2011, 04:38 AM
HenkdeWilde HenkdeWilde is offline
Newcomer
 
Join Date: Sep 2011
Posts: 1
Default Modifying Excel sheet using VB.net before importing


Currently I'm working on some code to modify a spreadsheet before it get's imported into SSIS, using a SSIS script task, so VB.Net.

However I'm having real trouble figuring out the correct code for doing a copy, paste as values for a particular range. In other words: my spreadsheet has formulas in it and I want to convert this to values before it gets imported. I have no trouble figuring out what it should be like in VBA, I just can't get it to work in VB.Net.

Does any one have a clue, or even better a code snippet on how to do this?

I can find alll sorts of examples in VB.net for excel just no Copy- paste (as values) ones.

Henk
Reply With Quote
  #2  
Old 09-06-2011, 10:56 AM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Hi,

At present I work on a computer without VS so below is the VBA code only. Let me know if You can solve it based on this or it requires the VB code:

Code:
Sub test() Dim rnFormulas As Range Set rnFormulas = ActiveSheet.Range("F11:F15") Application.ScreenUpdating = False rnFormulas.Copy rnFormulas.PasteSpecial xlPasteValues Application.CutCopyMode = False End Sub
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
Reply

Tags
copyandpaste


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
 
Modifying Excel sheet using VB.net before importing
Modifying Excel sheet using VB.net before importing
 
-->