Jump to content
xisto Community
Sign in to follow this  
connectpal

Manipulating Excel File With VB? opening and doing data stuff in vb

Recommended Posts

Part of my VB program is written with :'(1) open Excel files currentDate = Format(Date, "YYYY") & " " & Format(Date, "MM") & " " & Format(Date, "DD") & " " & "0000" & " " & "(WIDE)" filePath = "C:\nbutane\rsview\DLGLOG\RSVIEW\" & currentDate & ".dbf"When the VB executes, it'll open the file called 2001 11 23 0000 (Wide) with Excel.My problem is when the file name changed to 2001 11 23 0001 (Wide) , the VB can't access it because it's reading from '0000'. Sometimes the file will change to '0002' .... and so on.Please help. Thanks.

Share this post


Link to post
Share on other sites

'(1) open Excel files currentDate = Format(Date, "YYYY") & " " & Format(Date, "MM") & " " & Format(Date, "DD") & " " & "0000" & " " & "(WIDE)"
filePath = "C:\nbutane\rsview\DLGLOG\RSVIEW\" & currentDate & ".dbf"

My problem is when the file name changed to 2001 11 23 0001 (Wide) , the VB can't access it because it's reading from '0000'. Sometimes the file will change to '0002'

I dont understand onething... u have hard coded the 0000 like

" & "0000" & "

so when u want to open 0001 obviously u have to change.......

and .dbf for excel files... when microsoft chaged the exetnsion xls to dbf...and what is the extension for MSaccess files......

anyway how u r opening u r excel files in vb what are the extension or COM objects u have added i hope u cant handle ur excel files with out the extension or DOM object..like ordinary files..

be clear while asking

Share this post


Link to post
Share on other sites

connectpal wrote on May 23 2005, 08:11 AM

kalyan replies on May 17 2006, 10:47 AM

:D

 

You are asking him to be clear after 1 year? :P

Hey Kalyan, anyway how deep did u dig to get to this super old post???? :P

Share this post


Link to post
Share on other sites
Auto Refresh Pivot TableManipulating Excel File With VB?

When I am making changes to raw data I want the changes  reflect in the pivot table as well autometically, but its not happening.

I am using below code

1.Private Sub Worksheet_Calculate()Dim pt As PivotTableApplication.EnableEvents = FalseFor Each pt In Sheets("High Level Snapshot").PivotTables: pt.PivotCache.Refresh: Next ptApplication.EnableEvents = TrueEnd Sub

2.Private Sub Worksheet_Activate()ActiveWorkbook.RefreshAllEnd Sub

Private Sub Worksheet_Calculate()   Dim pt As PivotTable   Application.EnableEvents = False   For Each pt In Me.PivotTables: pt.RefreshTable: Next pt   Application.EnableEvents = TrueEnd Sub

 

-reply by Srikanth Naidu

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.